feat(frontend): add recoverable error boundaries with safe diagnostics - #275
Open
woahwhattheheck wants to merge 1 commit into
Open
woahwhattheheck wants to merge 1 commit into
woahwhattheheck wants to merge 1 commit into
Conversation
Isolate route and feature failures so a single crash cannot blank the shell or sibling widgets. Diagnostics mint a correlation ID, redact wallet/token/provider secrets, and classify retryable dependency errors versus invalid application state. Recovery actions cover retry, reload, and navigate-home. Async data hooks assert well-formed provider payloads and surface the same safe error banners.
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.
Summary
Closes #260.
Adds production-quality recoverable error boundaries and safe diagnostics so a failed provider, malformed response, or component exception cannot blank the application without a recovery path.
Design
diagnosticsutilities (src/utils/diagnostics.js): correlation IDs, deep redaction of wallet / token / provider secrets, classification of retryable dependency failures vs invalid application state, andassertWellFormedResponsefor malformed payloads.telemetrysink (src/utils/telemetry.js): accepts only pre-built diagnostics, re-redacts, and drops events that still look sensitive.ErrorBoundary: route- and feature-level isolation with Try again / Reload page / Go home, plus a visible correlation reference.useVaults/useVault/usePositions/useApyHistory): assert response shape, capture/redact failures, report telemetry, and pass correlation IDs intoErrorMessage.Acceptance criteria
Test evidence
test/utils/diagnostics.test.js— correlation IDs, redaction, classification, malformed responsestest/utils/telemetry.test.js— redacted sink + sensitive-drop guardtest/components/ErrorBoundary.test.jsx— injected render failures, retry remount, invalid-state (no retry), feature isolationtest/integration/errorBoundaries.test.jsx— shell survives page crash, async banner correlation, malformed payloads, sibling isolation regressionnpm test— 233 passed.tsc -b+vite build— clean.Compatibility / rollout
Out of scope