Fix: Prevent extension breakage when exiting wallet setup halfway - #10
Closed
stackedPenguin wants to merge 2 commits into
Closed
Fix: Prevent extension breakage when exiting wallet setup halfway#10stackedPenguin wants to merge 2 commits into
stackedPenguin wants to merge 2 commits into
Conversation
Fixes bug where exiting wallet setup partway through would cause: - Black screen flickering - Infinite loading spinner - Unusable popup Root cause: Incomplete wallet setup data remained in localStorage with no cleanup, causing RequireUserUnlocked to return null (black screen) and race conditions when opening/closing popups. Changes: - Add cleanupIncompleteOnboarding() to SecureStore for auto-cleanup of partial state - Integrate cleanup in KeyringStore.state() before returning NeedsOnboarding - Fix RequireUserUnlocked to show loading spinner instead of null/black screen - Open onboarding in full tab (not popup) matching first install behavior The extension now automatically detects and cleans up incomplete setup state, then opens onboarding in a full browser tab exactly like first install. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
jacklevin74
pushed a commit
that referenced
this pull request
Nov 16, 2025
Cherry-picked from PR #10 (fix/incomplete-wallet-setup-bug): - Add cleanupIncompleteOnboarding method to detect and remove partial setup data - Call cleanup before returning NeedsOnboarding state in KeyringStore - Open onboarding in full tab instead of popup for better UX consistency - Show loading spinner instead of blank screen while opening onboarding - Prevent duplicate tab opening by checking if already on onboarding page These changes complement our existing onboarding fixes by adding an additional layer of cleanup for incomplete state, ensuring the extension never gets stuck in a broken state during wallet setup. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflicts in RequireUserUnlocked.tsx by adopting master's approach of using QUERY_ONBOARDING constant instead of hardcoded string. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
jacklevin74
pushed a commit
that referenced
this pull request
Nov 16, 2025
…ixes This document summarizes all fixes applied to resolve: - Duplicate user account creation - Create vs import flow inconsistency - Auto-selection of first wallet - Active wallet validation bugs - Wallet data initialization errors - Automatic wallet recovery - App crash on incomplete onboarding - Localnet development support Includes testing instructions and integration history for PRs #10 and #11. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Owner
|
Integrated via cherry-pick in 895e8de. See ONBOARDING_FIXES.md |
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.
Problem
When users exited halfway through wallet setup and reopened the extension popup, the extension would break with:
Root Cause
The issue had multiple contributing factors:
RequireUserUnlockedreturnednullcausing black screenpopup.htmlwhich has no onboarding routingSolution
1. Automatic State Cleanup
File:
packages/secure-background/src/store/SecureStore.tsAdded
cleanupIncompleteOnboarding()method that:this.reset()2. Integrated Auto-Cleanup
File:
packages/secure-background/src/store/KeyringStore/KeyringStore.tsModified
state()method to callcleanupIncompleteOnboarding()before returningNeedsOnboardingstate, ensuring cleanup happens automatically before UI renders.3. Fixed Loading State & Tab Opening
File:
packages/secure-ui/src/RequireUserUnlocked/RequireUserUnlocked.tsxChanges:
<Loading />component instead ofnull(which caused black screen)options.html?onboarding=truein full browser tab (not popup)How It Works Now
Before (Broken):
RequireUserUnlockedreturnsnull→ black screenAfter (Fixed):
Testing
Files Changed
packages/secure-background/src/store/SecureStore.ts- Added cleanup methodpackages/secure-background/src/store/KeyringStore/KeyringStore.ts- Integrated cleanuppackages/secure-ui/src/RequireUserUnlocked/RequireUserUnlocked.tsx- Fixed loading & tab openingyarn.lock- Updated dependencies🤖 Generated with Claude Code