Repository navigation
fix: let a newer tab upgrade the library instead of waiting silently - #54
Merged
Merged
Conversation
A tab holding the library now closes it when a newer page asks to upgrade, and a page whose upgrade is held up by an older tab says so and carries on by itself once that tab lets go. Deletions still wait for other tabs to close.
This was referenced Oct 1, 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.
Why
When the library's IndexedDB version goes up (it just did, 6 → 7), any tab still holding the old version blocks the upgrade. The new page then sits on "Loading files…" forever, with no hint why. This happened during testing of #52, with an old page open in another browser.
What changes
data/workspace-database.tsblocking: when a newer page wants to upgrade, this tab closes its connection so the upgrade can finish.blockedVersion === null) are deliberately not given way to. Project deletion already waits for other tabs to close, and giving way would let this tab recreate the deleted library empty on its next read.blocked: forwarded to an optionalonBlockedpassed toopenWorkspaceDatabase.shell/project-root.tsx: the library is opened during boot, before the workbench mounts.Limits
blockinghandler, so they still have to be closed by hand this one time. Future upgrades benefit.Tests
data/workspace-database.test.tsshell/projects.integration.test.tsx: a held version-6 connection shows the waiting message. Once it closes, the files appear, migrated.pnpm checkpasses. The existing "deletes only what this tab asked for" test is occasionally flaky under full-suite load. That happens on main too, and it passes 8/8 in isolation with and without this change.