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

@uppy/tus - Add onShouldRetry options #3716

Closed
vp-aridhia opened this issue May 11, 2022 · 2 comments · Fixed by #3720
Closed

@uppy/tus - Add onShouldRetry options #3716

vp-aridhia opened this issue May 11, 2022 · 2 comments · Fixed by #3720
Labels

Comments

@vp-aridhia
Copy link

Hello 👋

Currently, tus-js-client supports onShouldRetry https://github.com/tus/tus-js-client/blob/master/docs/api.md#onshouldretry, which is also used internally by the @uppy/tus plugin. I'm currently having an issue when I'd like to also retry 401 responses after I refetch a new, valid auth token using a combination of onBeforeRequest and onAfterResponse.

Currently, I'm extending the plugin and replacing the bits I need to achieve this (upload method). But this would feel like a pretty good addition to the @uppy/tus.

@Murderlon
Copy link
Member

The retrying with exponential backoff is intricate and error prone logic to write yourself. We write that for you and test it so you don't have to worry about it. Perhaps it's better to only expose what HTTP status codes you want to retry on?

@vp-aridhia
Copy link
Author

vp-aridhia commented May 12, 2022

That would definitely be a viable strategy in our case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants