Skip to content

Frontend resilience — error boundaries, mutation errors, query invalidation#233

Merged
MichielDean merged 7 commits into
mainfrom
feat/sc-2sr07
Apr 15, 2026
Merged

Frontend resilience — error boundaries, mutation errors, query invalidation#233
MichielDean merged 7 commits into
mainfrom
feat/sc-2sr07

Conversation

@MichielDean
Copy link
Copy Markdown
Owner

Closes droplet sc-2sr07.

Cistern Agent added 7 commits April 14, 2026 20:38
…, query invalidation, admin role guard

- Add ErrorBoundary component wrapping root app and chart sections (dashboard, analytics)
- Add errorComponent to TanStack Router rootRoute for render error recovery
- Add ToastProvider (Radix Toast) with global mutation error handler in QueryClient defaults
- Add onError handlers to 4 previously-silent mutations: admin createTeam, quality-gates delete/evaluate, webhooks delete
- Add query invalidation after evaluateMutation (qualityGates.evaluations cache)
- Refactor profile.tsx from manual useState+try/catch to useMutation with proper cache invalidation
- Add beforeLoad role guard (requireOwner) on /admin route — redirects non-owners at router level
- Add 21 new tests covering all new functionality (error boundary, toast, mutation error toasts, role guard)
…h guard logic

- Removed redundant toast() calls from local onError handlers (admin, quality-gates, webhooks, profile) since the global QueryClient mutation onError already shows error toasts. This eliminated double toasts on mutation errors while preserving local error state management.
- Refactored requireOwner() to delegate to requireAuth() instead of duplicating the auth check.
- Consolidated duplicate toast import in main.tsx.
- Removed unused toast import from profile.tsx.
- Updated tests to match the global error handler pattern (added mutations.onError to test QueryClient configs, adjusted error message assertions).
@MichielDean MichielDean enabled auto-merge (squash) April 15, 2026 03:52
@MichielDean MichielDean merged commit cfb5b5a into main Apr 15, 2026
11 checks passed
@MichielDean MichielDean deleted the feat/sc-2sr07 branch April 15, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant