@checkstack/frontend 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @checkstack/frontend
2
2
 
3
+ ## 0.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 8a87cd4: Fixed query retry behavior for 401/403 errors
8
+
9
+ API calls that return 401 (Unauthorized) or 403 (Forbidden) errors are no longer retried, as these are definitive auth responses that won't succeed on retry. This prevents unnecessary loading states and network requests.
10
+
11
+ - Updated dependencies [8a87cd4]
12
+ - @checkstack/common@0.5.0
13
+ - @checkstack/auth-frontend@0.5.2
14
+ - @checkstack/catalog-frontend@0.3.6
15
+ - @checkstack/command-frontend@0.2.5
16
+ - @checkstack/frontend-api@0.3.2
17
+ - @checkstack/signal-common@0.1.3
18
+ - @checkstack/ui@0.3.1
19
+ - @checkstack/signal-frontend@0.0.9
20
+
3
21
  ## 0.2.5
4
22
 
5
23
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/frontend",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
package/src/App.tsx CHANGED
@@ -50,6 +50,25 @@ const queryClient = new QueryClient({
50
50
  gcTime: 5 * 60 * 1000,
51
51
  // Don't refetch on window focus by default (can be overridden per query)
52
52
  refetchOnWindowFocus: false,
53
+ // Custom retry logic: don't retry on 401/403 auth errors
54
+ // These are definitive responses that won't succeed on retry
55
+ retry: (failureCount, error) => {
56
+ // Check if it's an HTTP error with status code
57
+ const status = (error as { status?: number })?.status;
58
+ // Also check for oRPC error codes
59
+ const code = (error as { code?: string })?.code;
60
+
61
+ // Don't retry on authentication/authorization errors
62
+ if (status === 401 || status === 403) return false;
63
+ if (code === "UNAUTHORIZED" || code === "FORBIDDEN") return false;
64
+
65
+ // Default: retry up to 3 times for other errors
66
+ return failureCount < 3;
67
+ },
68
+ },
69
+ mutations: {
70
+ // Mutations should not retry by default (user can re-submit)
71
+ retry: false,
53
72
  },
54
73
  },
55
74
  });