fix(lib): handle storage fallbacks and local tokens (#420) - #435
Open
Danlee76 wants to merge 5 commits into
Open
fix(lib): handle storage fallbacks and local tokens (#420)#435Danlee76 wants to merge 5 commits into
Danlee76 wants to merge 5 commits into
Conversation
Add regression coverage for stale wallet sessions when localStorage writes fail and for settings persistence when browser storage is unavailable. These cases need coverage because Safari private mode and restricted webviews can allow reads while throwing on writes.
Assert that ErrorBoundary rendering remains pure when the breaker UI is active and that local token lookup does not reuse testnet contracts. These checks protect against render-phase timers and opaque local-network token failures.
Read wallet sessions from the in-memory fallback before localStorage so the current session wins when browser storage writes fail but reads still succeed. Guard Settings writes and skip the initial mount rewrite so unavailable localStorage degrades to non-persistent settings instead of crashing. Closes conduit-protocol#420 Closes conduit-protocol#422
Move ErrorBoundary breaker recovery scheduling into componentDidUpdate so timers are created after committed state changes instead of during render. Return an explicit local token list instead of falling through to testnet contract addresses, making unconfigured local networks fail clearly. Closes conduit-protocol#421 Closes conduit-protocol#423
Record the fixed storage fallback, ErrorBoundary reset scheduling, guarded settings persistence, and local token behavior in the Unreleased changelog. The PR has been checked with typecheck, lint, unit tests, and production build locally.
|
@Danlee76 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! 🚀 |
Contributor
|
Merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes four browser/runtime edge cases around storage fallback behavior, ErrorBoundary recovery scheduling, settings persistence, and local token metadata.
Type of change
Related issue
Closes #420
Closes #421
Closes #422
Closes #423
Changes
lib/wallet-storage.tscomponents/ErrorBoundary.tsxrender()intocomponentDidUpdate().app/settings/page.tsxlib/tokens.tsCHANGELOG.md[Unreleased].Checklist
npm run typecheck— no errorsnpm run lint— no warningsnpm test— all tests passnpm run build— production build succeedsalert())'use client'added only where genuinely neededCHANGELOG.mdupdated under[Unreleased]Screenshots
No visible UI changes.
Notes for reviewers
Browser wallet testing was not required for these storage/library-only regression fixes; local unit coverage exercises the failing cases directly.