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

BUG: RTK Query: You can no longer set 'maxRetries' to 0 #2934

Closed
ritterb82 opened this issue Nov 22, 2022 · 4 comments
Closed

BUG: RTK Query: You can no longer set 'maxRetries' to 0 #2934

ritterb82 opened this issue Nov 22, 2022 · 4 comments
Milestone

Comments

@ritterb82
Copy link

ritterb82 commented Nov 22, 2022

In the latest update there was updates to the retry logic. But the updates broke the ability to set maxRetries to 0. I believe this is due to the possibleMaxRetries array that now exists and gets filtered by Boolean. Which cause 0 to be tossed out.

So then at that point, it just goes back to the default of 5.

const possibleMaxRetries: number[] = [
5,
((defaultOptions as any) || EMPTY_OPTIONS).maxRetries,
((extraOptions as any) || EMPTY_OPTIONS).maxRetries,
].filter(Boolean)
const [maxRetries] = possibleMaxRetries.slice(-1)

@ritterb82 ritterb82 changed the title BUG: You can no longer set 'maxRetries' to 0 BUG: RTK Query: You can no longer set 'maxRetries' to 0 Nov 22, 2022
@markerikson markerikson added this to the 1.9.x milestone Nov 22, 2022
@OliverRadini
Copy link
Contributor

Would it be alright if I picked this up? Looking to find some issues to work on and this seems interesting

@markerikson
Copy link
Collaborator

Sure, please do!

@OliverRadini
Copy link
Contributor

@markerikson thanks, hopefully the code in the PR properly resolves the issue

@markerikson
Copy link
Collaborator

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

No branches or pull requests

3 participants