File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,16 @@ export function getQueryClient() {
4040 return false
4141 }
4242
43+ // Skip retries for specific pathnames to avoid unnecessary load
44+ // CRITICAL: We must still retry 429 (rate limit) errors even on these pathnames.
45+ // Without this exception, queries fail immediately on rate limits, causing the
46+ // frontend to issue fresh requests (via refetch/user actions), which amplifies
47+ // the rate limiting problem. By retrying 429s with proper backoff (using the
48+ // retryAfter header below), we respect rate limits and prevent request storms.
4349 if (
4450 error instanceof ResponseError &&
4551 error . requestPathname &&
4652 SKIP_RETRY_PATHNAME_MATCHERS . some ( ( matchFn ) => matchFn ( error . requestPathname ! ) ) &&
47- // Still retry on 429s (rate limit) so that retry after is respected
4853 error . code !== 429
4954 ) {
5055 return false
You can’t perform that action at this time.
0 commit comments