Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: don't retry queries on 4xx errors (#32923)

Alaister Youngc5d664d214a1
diff --git a/apps/studio/data/query-client.ts b/apps/studio/data/query-client.ts
index 04b81d5cf50..b206f55d0de 100644
--- a/apps/studio/data/query-client.ts
+++ b/apps/studio/data/query-client.ts
@@ -19,8 +19,13 @@ export function getQueryClient() {
queries: {
staleTime: 60 * 1000, // 1 minute
retry(failureCount, error) {
- // Don't retry on 404s
- if (error instanceof ResponseError && error.code === 404) {
+ // Don't retry on 4xx errors
+ if (
+ error instanceof ResponseError &&
+ error.code !== undefined &&
+ error.code >= 400 &&
+ error.code < 500
+ ) {
return false
}