Persist the browser demo account and storage across reloads - #526
Open
Dzejkop wants to merge 1 commit into
Open
Conversation
Dzejkop
force-pushed
the
codex/persistent-browser-demo
branch
2 times, most recently
from
September 9, 2026 15:47
deb1ee9 to
e1cdf67
Compare
Dzejkop
added this pull request to stack #529
September 10, 2026 09:20
Dzejkop
force-pushed
the
codex/persistent-browser-demo
branch
from
September 10, 2026 09:33
e1cdf67 to
19a9a8c
Compare
Dzejkop
force-pushed
the
codex/persistent-browser-demo
branch
from
September 10, 2026 09:39
19a9a8c to
aa77e1e
Compare
Dzejkop
marked this pull request as ready for review
September 10, 2026 12:22
Dzejkop
requested review from
Guardiola31337,
Takaros999,
danielle-tfh,
kilianglas,
murph,
paolodamico and
philsippl
as code owners
September 10, 2026 12:22
Dzejkop
force-pushed
the
codex/persistent-browser-demo
branch
from
September 10, 2026 12:28
aa77e1e to
6e36f51
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6e36f51. Configure here.
| await new Promise((resolve) => setTimeout(resolve, 500)); | ||
| } | ||
| saved.registered = true; | ||
| saveDemoProfile(saved); |
There was a problem hiding this comment.
Failed save leaves profile flags inconsistent
Low Severity
register and issue set saved.registered / saved.credentialIssued on the live profile.current object before saveDemoProfile returns. A failed write leaves memory marked complete while React state and localStorage stay incomplete, so Derive stays enabled and can persist a new seed as already registered.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 6e36f51. Configure here.
piohei
approved these changes
Sep 10, 2026
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.


Reopen the same staging demo account and encrypted OPFS databases after a page reload. Previously every load generated a new database key, storage namespace, and seed, leaving the previous databases inaccessible.
Validation: production Next.js build and TypeScript checks pass; four persistence tests pass. A Chrome smoke check verified reload key/identity retention, re-derived identity retention, restored-progress button gating, and corrupt-profile rejection. No staging registration or issuance calls were made.
Stacked above #523. This PR changes only the demo.
Note
Low Risk
Demo-only example changes with no production WalletKit or auth paths affected; localStorage holds staging keys by design with documented caveats.
Overview
The Next.js uniffi-web-authenticator-poc demo no longer throws away the WalletKit storage ID, database key, and seed on every reload. It adds a versioned
demo-profilein localStorage (with validation and fail-closed behavior for corrupt or unsupported versions) and wirespage.tsxto restore that profile when callinginitializeWalletKit, persist progress after register/issue/derive, and restore UI gating for registration and issuance after reload.Generate proof now requires the authenticator to be initialized again (not only that a credential was issued). README copy is updated for persistent OPFS reopening and staging-only key retention;
bun testcovers profile persistence, and test files are excluded from the Next TypeScript build.Reviewed by Cursor Bugbot for commit 6e36f51. Bugbot is set up for automated code reviews on this repo. Configure here.