Repository navigation
fix(web): sign-in and writes hang when another tab holds old storage; bound every sign-in wait - #79
Merged
Merged
Conversation
…orage upgrade An old Dash Forge tab holding the dash-forge IndexedDB at v1 blocked the v2 upgrade; idb.ts dropped the blocked open and every later open queued behind it without firing, so Create, Import and every write that touches IndexedDB waited forever. Keep the one pending open, fail fast with a named error while blocked, and cap the open at 10 s. Bound the SDK download, connect and passkey ceremonies in the sign-in sheet, with named errors and Try again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…s kept out of the DOM A write waiting for this identity's writer lock (this tab's queue or the cross-tab Web Lock) now gives up after 3 minutes with a named error instead of waiting forever behind a stuck holder. A tab whose storage a newer build upgrades closes its connection and shows a reload banner. Import names each step on its button. The pasted private key and passphrases are uncontrolled inputs inside forms, so they never appear in a value attribute or in Chrome's console warning. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 32 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (19)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 27, 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.
Summary
Owner S1 reports:
Root cause (one cause for all three)
A second Dash Forge tab is holding the
dash-forgeIndexedDB open at an older version, so the upgrade is blocked. The owner's tab strip shows a second forge tab.660d5a1raisedDB_VERSIONfrom 1 to 2 (the inbox store). A tab still running an older build keeps the database open at v1 and never releases it: that build has noonversionchangehandler.lib/idb.tsrejected ononblockedand then dropped the blocked request. Every laterindexedDB.open(v2)queued behind the blocked upgrade and never fired any event.listVaults(), which runs before its first Platform call;createRepo's journal.47h9EpDd…still has only keys 0–4, so nothing was written and there is nothing to recover or double-register.Reproduction (Playwright)
Other suspects were ruled out. None of them reproduces the hang:
Two of the injections I tried also leave a bare spinner forever, a secondary issue:
Fix
lib/idb.ts:onversionchange, a tab closes its connection and shows a "Dash Forge was updated in another tab — Reload" banner (components/storage-updated.tsx), so future upgrades are never blocked by a current build.lib/timeout.tsaddswithTimeout;lib/auth/connect.tsbounds the evo-sdk download plus wasm init (5 min cap for slow links) and the connect (20 s), each with a named error;lib/sdk/write.tsserialized): waiting for this identity's writer lock is bounded to 3 min. That covers both this tab's queue and the cross-tab Web Lock, which is aborted throughAbortSignal. A waiter that gives up gets "Another Dash Forge tab … is still finishing a write for this identity" and never runs. A write that already holds the lock is not cut off.type=passwordinput outside any<form>. React mirrored the key into the DOMvalueattribute, and Chrome's "[DOM] Password field is not contained in a form" warning can print that element. The key and the vault passphrases are now uncontrolled inputs inside forms, and the key is cleared after use.Coordination
ensureSdkfrom the outside, so a retry joins the in-flight connect.serialized()is the one lib/sdk change.Cites: D-013, D-024, D-025 and D-058 (related hang classes, not fixed here), and the owner reports above.
Tests
e2e/signin-resilience.spec.tsruns in Chromium and WebKit (a newwebkitproject scoped to this spec). All 12 runs pass on this branch. All 6 specs fail on master in Chromium; s1–s3, the ones run there, fail on master in WebKit too.Unit tests:
lib/timeout.test.ts;lib/sdk/writer-lock.test.ts: waiters behind a stuck in-tab write or a stuck cross-tab Web Lock give up and never run, while a lock holder is not cut off. The two give-up tests fail on master.pnpm test: 1540 passed.pnpm typecheckandpnpm lintare clean.Workaround until this deploys: close or reload every other forge.dashhq.org tab, then retry.
🤖 Generated with Claude Code