feat(extension): implement popup route error boundaries with settings… - #759
Conversation
… recovery and safe logging
|
@Tobi-8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
📝 WalkthroughWalkthroughThis PR adds a React error boundary component to the extension wallet popup that catches unhandled render errors, sanitizes sensitive content in error messages, generates unique error identifiers for support reference, provides a fallback UI with recovery options, and integrates recovery navigation into the main router. ChangesError Boundary and Fallback Components
Sequence DiagramsequenceDiagram
participant User as User/Extension
participant Routes as Routes
participant ErrorBoundary as ErrorBoundary
participant Fallback as ErrorFallback UI
participant Logger as Console/Logger
User->>Routes: navigate or interact
Routes->>Routes: render child component
Routes->>ErrorBoundary: throw uncaught error
ErrorBoundary->>ErrorBoundary: sanitizeMessage()
ErrorBoundary->>ErrorBoundary: generateErrorId()
ErrorBoundary->>Logger: log sanitized message + errorId
ErrorBoundary->>Fallback: render with error & errorId
Fallback->>Logger: invoke onReport(errorId, message)
User->>Fallback: click "Go to home"
Fallback->>Fallback: call resetErrorBoundary()
Fallback->>Routes: navigate to /home
Routes->>Routes: render home route
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/extension-wallet/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx`:
- Around line 120-126: The test "redacts Stellar secret key (56 chars starting
with S)" uses an invalid key with em-dashes so the Stellar regex never matches
and the test passes for the wrong reason; replace the test string assigned to
stellarSecretKey in ErrorBoundary.test.tsx with a 56-character base32 string
that begins with 'S' and contains only characters A-Z and 2-7 (e.g., 'S' + 55
characters from [A-Z2-7]) so the redaction logic (the regex in
SENSITIVE_PATTERNS / the Stellar redaction case inside the ErrorBoundary/Bomb
rendering path) is actually exercised by harness(<Bomb ... />) and the
assertions checking that the original key is not in the document and "redacted"
is present remain valid.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 63b26b2b-a29f-4d0f-be73-2463fff81047
📒 Files selected for processing (4)
apps/extension-wallet/src/components/ErrorBoundary/ErrorBoundary.tsxapps/extension-wallet/src/components/ErrorBoundary/ErrorFallback.tsxapps/extension-wallet/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsxapps/extension-wallet/src/router/index.tsx
|
Given the very limited time available, I used AI assistance to complete the task before the deadline. I understand if that's a factor in evaluation, but I'd appreciate consideration of the time constraints under which the submission was made. |
… recovery and safe logging
Description
Type of Change
Security Impact
Testing
Test Coverage
Manual Testing Steps
Breaking Changes
Checklist
For High-Security Changes
Related Issues
Closes #612
Summary by CodeRabbit
Release Notes