Skip to content

Add default errorRetryCount of 5#4197

Closed
ryohiy wants to merge 2 commits intovercel:mainfrom
ryohiy:feat/add-default-error-retry-count
Closed

Add default errorRetryCount of 5#4197
ryohiy wants to merge 2 commits intovercel:mainfrom
ryohiy:feat/add-default-error-retry-count

Conversation

@ryohiy
Copy link

@ryohiy ryohiy commented Dec 10, 2025

I apologize for creating this PR without waiting for feedback on the discussion.
This PR implements the change proposed in #4196.

I was planning to wait for a response in the discussion, but I decided to create this PR because this might be something that needs to be fixed soon, and the change itself is minimal.

I'll keep this as a Draft PR until there's movement in the discussion. There's no need to review this PR until the discussion progresses.

Sorry for the noise. Thank you.

@vercel
Copy link

vercel bot commented Dec 10, 2025

@ryohiy is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 10, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@ryohiy ryohiy marked this pull request as ready for review January 18, 2026 14:46
@ryohiy ryohiy requested review from huozhi and shuding as code owners January 18, 2026 14:46
@ryohiy
Copy link
Author

ryohiy commented Jan 18, 2026

Since the discussion wasn't making progress, I've gone ahead and opened this PR.
If it's not needed, feel free to close it—I'd just appreciate any feedback you might have on this PR. Thank you.

@shuding
Copy link
Member

shuding commented Feb 1, 2026

SWR uses exponential backoff for error retries (capped at 2^8) and 5s as the default interval. This means that it will retry after 5s, 10s, 20s, 40s, 80s, 160s, 320s, 640s, 1280s (and then fixed at 1280s). 1280s is 21 minutes, and this means that in 40+ minutes there will be only <= 9 retries. The cost is really trivial for a web application and it will be extremely rare to happen, as SWR also pauses it when the app is not focused.

@shuding shuding closed this Feb 1, 2026
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.

2 participants