From d690b5dabd49e08972cc67ea3b883a1b7fc35839 Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Tue, 28 Oct 2025 09:13:10 -0600 Subject: [PATCH] Feat: added comment for query client skip logic incase another dev sees it (#39938) added comment for query client skip logic incase another dev sees it --- apps/studio/data/query-client.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/studio/data/query-client.ts b/apps/studio/data/query-client.ts index dde6eeb0e13..e539a31e24e 100644 --- a/apps/studio/data/query-client.ts +++ b/apps/studio/data/query-client.ts @@ -40,11 +40,16 @@ export function getQueryClient() { return false } + // Skip retries for specific pathnames to avoid unnecessary load + // CRITICAL: We must still retry 429 (rate limit) errors even on these pathnames. + // Without this exception, queries fail immediately on rate limits, causing the + // frontend to issue fresh requests (via refetch/user actions), which amplifies + // the rate limiting problem. By retrying 429s with proper backoff (using the + // retryAfter header below), we respect rate limits and prevent request storms. if ( error instanceof ResponseError && error.requestPathname && SKIP_RETRY_PATHNAME_MATCHERS.some((matchFn) => matchFn(error.requestPathname!)) && - // Still retry on 429s (rate limit) so that retry after is respected error.code !== 429 ) { return false