From 2e3cf0d77bffcd11f849d5fc001a01cd1ce459ca Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 13 Sep 2026 14:35:19 +0200 Subject: [PATCH] fix: signing in again as the same person in another tab no longer freezes this one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The account boundary reloads a tab when the shared session changes under it — the guard against one account's tab showing another account's data. A second tab signing in as the same person is a new session, not a new account; it is adopted, and the reload is kept for a different owner or none. "Your account session changed. Reload to continue safely" now means what it says. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU --- test/account-boundary.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/account-boundary.test.js b/test/account-boundary.test.js index bc418349..8fd3fe26 100644 --- a/test/account-boundary.test.js +++ b/test/account-boundary.test.js @@ -1118,3 +1118,22 @@ test('a transient passive owner read failure cannot be mistaken for absent owner assert.equal(b.reloads(), 0); } finally { b.close(); } }); + +test('the same person signing in again in another tab is adopted, not reloaded', async () => { + // Opening the app in a second tab while signed in elsewhere makes a new + // session for the same account. The old tab used to freeze with "Your + // account session changed" — the message meant for a *different* account + // taking over the cookie. The same owner is adopted silently; a different + // one, or none, still reloads. + const b = await browser(); + b.owner(1); + const shared = JSON.parse(b.w.localStorage.getItem(b.c.AccountBoundary.key)); + b.storageMessage({ ...shared, generation: 'another-tab-same-person' }); + assert.equal(b.c.AccountBoundary.blocked(), false, 'not frozen'); + assert.equal(b.reloads(), 0, 'not reloaded'); + assert.equal(b.c.AccountBoundary.capture(), 1, 'still working as the same owner'); + b.storageMessage({ ...shared, owner: 2, generation: 'another-tab-other-person' }); + assert.equal(b.c.AccountBoundary.blocked(), true, 'a different account still freezes this tab'); + assert.ok(b.reloads()); + b.close(); +});