Skip to content

Commit d690b5d

Browse files
authored
Feat: added comment for query client skip logic incase another dev sees it (supabase#39938)
added comment for query client skip logic incase another dev sees it
1 parent 6e6391b commit d690b5d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/studio/data/query-client.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)