-
Notifications
You must be signed in to change notification settings - Fork 209
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
#409 Implement timeout support to networking Client #423
Conversation
c614bb0
to
bb47005
Compare
Hi @mnylen, thanks for raising this PR. I haven't been able to look at it yet, but might get to it by the end of the week. |
return new Promise(resolve => { | ||
responseTimerId = setTimeout(() => { | ||
resolve(response); | ||
}, 10000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10 secs is a bit much for a test timeout, please lower it to 2 or 3 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just have a nitpick over the timeout value for the test case. Thank you for the PR, we really appreciate you taking the time for doing this.
@Widcket thanks for the feedback. I changed the test timeout. Sorry it took a while. Switched companies and not in a project that uses this anymore and don't have the setup locally on my computer anymore either, but hopefully others can find this change useful. :) |
Thanks for coming back and pushing the change! |
Changes
Auth0
that is passed tonetworking.Client
(defaults to 10 seconds)networking.Client
timeout after the specified timeout, and any ongoing requests are cancelled usingAbortController
created for each request.TimeoutError
References
Please include relevant links supporting this change such as a:
Testing
Can be tested in e.g. iOS Simulator using Network Link Condition preferences pane. Setting the packet drop ratio to 100 % will cause the requests to never complete. With this change,
TimeoutError
will be thrown after attempting the request for 10 seconds.Checklist