Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wasm): support request timeout #1760

Merged
merged 4 commits into from
Jan 16, 2025
Merged

Conversation

flisky
Copy link
Contributor

@flisky flisky commented Feb 24, 2023

Thanks for PR #1755, making wasm timeout support is super easy now.

fixes #1135 supersede #1274

@flisky
Copy link
Contributor Author

flisky commented May 17, 2023

I've replace gloo-timers with wasm-bindgen functions.

(For the potential question: why not use web_sys::Window::set_timout_*? Because Window doesn't work in nodejs & webworker. However, I can switch into predefined functions if Window is only target.)

@aorticweb
Copy link

is there a plan to merge this please?

@Aursen
Copy link

Aursen commented Jul 25, 2024

Hi any news about this one? To know if it's planned to add it or not?

@chris13524
Copy link

I don't usually bump threads, but curious what is the holdup on this one? 😄 Seems like an easy win

@seanmonstar
Copy link
Owner

So sorry this slipped, yes this seems much simpler. Happy to add it!

It seems like there's a test failure in WASM, though. Related?

@flisky
Copy link
Contributor Author

flisky commented Jan 15, 2025

Yes. I've shorten the timeout to reproduce timeout error in firefox.

It turns out that error message keywords didn't match, @seanmonstar

Copy link
Owner

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@seanmonstar seanmonstar merged commit 0f360b8 into seanmonstar:master Jan 16, 2025
36 checks passed
@Nuhvi
Copy link
Contributor

Nuhvi commented Feb 6, 2025

@seanmonstar will there be a release with this any time soon? Thanks.

kodiakhq bot pushed a commit to pdylanross/fatigue that referenced this pull request Mar 12, 2025
Bumps reqwest from 0.12.12 to 0.12.13.

Release notes
Sourced from reqwest's releases.

v0.12.13
What's Changed

Add Form::into_reader() for blocking multipart forms.
Add Form::into_stream() for async multipart forms.
Add support for SOCKS4a proxies.
Fix decoding responses with multiple zstd frames.
Fix RequestBuilder::form() from overwriting a previously set Content-Type header, like the other builder methods.
Fix cloning of request timeout in blocking::Request.
Fix http3 synchronization of connection creation, reducing unneccesary extra connections.
Fix Windows system proxy to use ProxyOverride as a NO_PROXY value.
Fix blocking read to correctly reserve and zero read buffer.
(wasm) Add support for request timeouts.
(wasm) Fix Error::is_timeout() to return true when from a request timeout.

New Contributors

@​obi1kenobi made their first contribution in seanmonstar/reqwest#2524
@​decathorpe made their first contribution in seanmonstar/reqwest#2529
@​flisky made their first contribution in seanmonstar/reqwest#1760
@​0x676e67 made their first contribution in seanmonstar/reqwest#2527
@​maximevtush made their first contribution in seanmonstar/reqwest#2534
@​Property404 made their first contribution in seanmonstar/reqwest#2554
@​G1gg1L3s made their first contribution in seanmonstar/reqwest#2544
@​coastalwhite made their first contribution in seanmonstar/reqwest#2562
@​Fizcko made their first contribution in seanmonstar/reqwest#2559
@​markussilvan made their first contribution in seanmonstar/reqwest#2573
@​aunovis-heidrich made their first contribution in seanmonstar/reqwest#2593

Thanks!

@​seanmonstar
@​paolobarbolini
@​Nuhvi
@​Andrey36652

Full Changelog: seanmonstar/[email protected]



Changelog
Sourced from reqwest's changelog.

v0.12.13

Add Form::into_reader() for blocking multipart forms.
Add Form::into_stream() for async multipart forms.
Add support for SOCKS4a proxies.
Fix decoding responses with multiple zstd frames.
Fix RequestBuilder::form() from overwriting a previously set Content-Type header, like the other builder methods.
Fix cloning of request timeout in blocking::Request.
Fix http3 synchronization of connection creation, reducing unneccesary extra connections.
Fix Windows system proxy to use ProxyOverride as a NO_PROXY value.
Fix blocking read to correctly reserve and zero read buffer.
(wasm) Add support for request timeouts.
(wasm) Fix Error::is_timeout() to return true when from a request timeout.




Commits

e44e371 v0.12.13
e83e138 Added osv-scanner.toml file to ignore npm packages in wasm examples during vu...
7e85d2f ci: pin once-cell in msrv job (#2594)
c4a9fb0 test HTTP connection reuse with new zstd fix (#2587)
6f9d0ee fix: support HTTP responses containing multiple ZSTD frames (#2583)
44ac897 perf(decoder): compile-time validation of decoder header value (#2580)
0bcba46 chore: remove empty wasm shell function (#2573)
00b15b9 fix using Windows ProxyOverride registry value as a NO_PROXY (#2559)
0cf27a9 chore: Update js-sys from 0.3.45 -> 0.3.77 (#2562)
e4ca07e ci: pin native-tls in msrv job (#2563)
Additional commits viewable in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RequestBuilder doesn't have a timeout in wasm module
7 participants