Why this matters now
ErrorBoundary.tsx is a complete, well-implemented class component with retry logic, but it is used nowhere. App.tsx renders <RootNavigator /> with no boundary. Any uncaught render error (e.g. null dereference on a corrupted persisted MMKV state) crashes the entire app to a blank screen with no recovery path for the user.
Problem / What
App.tsx renders <RootNavigator /> directly. The ErrorBoundary component has zero consumers in the entire codebase. There is no "clear app data" escape hatch if persisted state becomes corrupted.
Key Challenges
- Granularity: a single top-level boundary vs. per-screen boundaries — the right answer is both (top-level as safety net, per-screen for targeted recovery).
- "Try Again" alone is insufficient for corrupted state — a "Clear data and restart" secondary action must be available but not the default.
componentDidCatch must log errors for debugging.
Acceptance Criteria
Relevant files
src/components/ErrorBoundary.tsx
App.tsx
src/screens/HomeScreen.tsx, TaskListScreen.tsx, WalletScreen.tsx, ProfileScreen.tsx
Labels
type: reliability, difficulty: intermediate, area: error-handling
Why this matters now
ErrorBoundary.tsxis a complete, well-implemented class component with retry logic, but it is used nowhere.App.tsxrenders<RootNavigator />with no boundary. Any uncaught render error (e.g. null dereference on a corrupted persisted MMKV state) crashes the entire app to a blank screen with no recovery path for the user.Problem / What
App.tsxrenders<RootNavigator />directly. TheErrorBoundarycomponent has zero consumers in the entire codebase. There is no "clear app data" escape hatch if persisted state becomes corrupted.Key Challenges
componentDidCatchmust log errors for debugging.Acceptance Criteria
App.tsxwraps<RootNavigator>in<ErrorBoundary>.HomeScreen,TaskListScreen,WalletScreen,ProfileScreeneach have an individual<ErrorBoundary>with a screen-specific fallback.ErrorBoundarycallsconsole.error(error, info)incomponentDidCatch.components.test.tsxgains a test: component throws → boundary renders fallback, no crash.Relevant files
src/components/ErrorBoundary.tsxApp.tsxsrc/screens/HomeScreen.tsx,TaskListScreen.tsx,WalletScreen.tsx,ProfileScreen.tsxLabels
type: reliability,difficulty: intermediate,area: error-handling