Frontend resilience — error boundaries, mutation errors, query invalidation#233
Merged
Conversation
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).
…nline error, ErrorBoundary reload
…l in evaluateMutation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes droplet sc-2sr07.