Skip to content

#1082: Start hardening wallet session hydrate against malformed storage - #1160

Open
Ajibose wants to merge 1 commit into
LabsCrypt:mainfrom
Ajibose:fix/1082-wallet-session-hydrate-guard
Open

#1082: Start hardening wallet session hydrate against malformed storage#1160
Ajibose wants to merge 1 commit into
LabsCrypt:mainfrom
Ajibose:fix/1082-wallet-session-hydrate-guard

Conversation

@Ajibose

@Ajibose Ajibose commented Jul 30, 2026

Copy link
Copy Markdown

Closes #1082

Summary

  • Trims the raw localStorage value before JSON.parse in readStoredSession

Not yet done

  • try/catch around the full hydrate/parse path with fallback to a clean disconnected state
  • Clearing the invalid stored value on failure (currently only handled for the empty/whitespace case)
  • Regression test in wallet-context.test.tsx with a malformed stored session

Test plan

  • Add regression test with malformed stored session
  • Manually corrupt flowfi.wallet.session.v1 in localStorage and confirm app doesn't crash

Small first step toward LabsCrypt#1082. Full try/catch error boundary around
hydrate, clearing invalid stored sessions, and the regression test
still need to be added in a follow-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant