Repository navigation
[AI] Run Actual in one browser tab at a time - #109
Merged
Merged
Conversation
Replace the multi-tab SharedWorker coordinator with a single-tab model. Each tab takes the "actual-backend" Web Lock (ifAvailable) before starting its own dedicated backend Worker and holds it for the life of the page. A tab that can't get the lock starts no backend and shows "Already open in another tab" on the FatalError screen. If the lock request rejects (storage blocked), start anyway so the real storage error is shown. Delete the coordinator, the WorkerBridge, the SharedWorker entry point, the OpenID-callback workaround, and the production importScripts retry that only existed because a failed load bricked the SharedWorker. Let the service worker pass /gocardless/ through to the sync server, whose link page closes the bank-sync tab; otherwise that tab loaded the app and showed the already-open message. Co-Authored-By: Claude Opus 5.5 <[email protected]>
chrisvasz
force-pushed
the
claude/single-tab-lock
branch
from
October 6, 2026 02:11
09b936d to
babf1ed
Compare
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.
Replace the multi-tab SharedWorker coordinator with a "one tab at a time" model, ahead of the move from absurd-sql to sqlite-wasm/OPFS (where only one worker per origin can hold the databases).
actual-backendWeb Lock (ifAvailable: true) and holds it for the life of the page. If it gets the lock, it starts the backend in its own dedicated Worker, as iOS, Android and Playwright already did. If not, it starts no backend and shows "Already open in another tab" on the existing FatalError screen.WorkerBridge, the SharedWorker entry, the OpenID-callback workaround, and the productionimportScriptsretry that only existed because a failed load bricked the SharedWorker (dev keeps its retries). The SharedArrayBuffer/COOP/COEP code stays; absurd-sql still needs it./gocardless/through to the sync server, whose link page closes the bank-sync tab. Without this, that tab loaded the full app and showed the already-open message.Deliberately left out: takeover, messaging between tabs, and auto-retry when the other tab closes.
Known limitations:
Tested:
yarn typecheck,yarn lint, loot-core and desktop-client unit tests. In a browser against the dev server: a second tab shows the message and starts no backend; after closing the first tab, reloading the second loads normally; reloading the only tab works. Not tested: Safari, the GoCardless and Enable Banking flows, and the production service worker. No unit tests cover the lock itself.🤖 Generated with Claude Code