Skip to content

fix(wallet): guard the three unguarded localStorage accesses - #759

Closed
yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/wallet-storage-guard-705
Closed

yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/wallet-storage-guard-705

Conversation

@yggdrasilworld

@yggdrasilworld yggdrasilworld commented Oct 14, 2026 •

Copy link
Copy Markdown

What

WalletContext called localStorage.getItem/removeItem/setItem unguarded — where storage access throws (Safari private mode, blocked site data), the mount effect threw and initializing never cleared, leaving wallet actions disabled.

Fix

Wrapped all three in the same best-effort try/catch auth.ts uses — in-memory state still works when storage can't be written.

Resolves #705 · Related: #190

Payment: Base USDC 0xD40Df5c27cEa7dd78A3c345401995c319589334e

WalletContext called getItem/removeItem/setItem unguarded — where storage
access throws (Safari private mode, blocked site data), the mount effect
threw,  never cleared, and wallet actions stayed disabled.

Wrapped in the same best-effort try/catch auth.ts uses — the in-memory
state still works even when storage can't be written.

Resolves MergeFi#705
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@yggdrasilworld is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

WalletContext touches localStorage without try/catch in three places — Safari private mode throws

1 participant