Skip to content

[Backend] frontend/src/context/wallet-context.tsx reducer has no error boundary for malformed persisted session JSON #1082

Description

@grantfox-oss

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

frontend/src/context/wallet-context.tsx reads a persisted wallet session from storage on hydrate. If that stored value is corrupted or from an older, incompatible schema (e.g. after a shape change), JSON.parse or the reducer's assumptions about field presence can throw during initial render, crashing the whole app shell before any wallet UI mounts.

Acceptance criteria

  • Wrap the hydrate/parse step in a try/catch that falls back to a clean disconnected state
  • Clear the invalid stored value so the app doesn't loop on the same bad data
  • Add a regression test with a deliberately malformed stored session

Files to touch

  • frontend/src/context/wallet-context.tsx
  • frontend/src/context/wallet-context.test.tsx

Out of scope

  • Changing the wallet connection flow itself
  • Migrating storage format

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendFrontend related tasks

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions