feat(fe): keep an app's session across a page load - #4272
Open
sea-snake wants to merge 4 commits into
Open
Conversation
sea-snake
marked this pull request as ready for review
August 22, 2026 18:16
|
✅ No security or compliance issues detected. Reviewed everything up to 9b420ec. Security Overview
Detected Code Changes
|
sea-snake
force-pushed
the
fe/app-session-store
branch
from
August 22, 2026 18:45
0fb539a to
49d4a11
Compare
sea-snake
force-pushed
the
fe/app-session-store
branch
from
August 22, 2026 19:07
49d4a11 to
4b40492
Compare
sea-snake
force-pushed
the
fe/app-session-store
branch
from
August 22, 2026 19:25
4b40492 to
1aad6be
Compare
A session outlives the tab that created it, so the frontend has to store the chain it holds — otherwise a sibling subdomain asking for the first time, or a user returning to a closed tab, would mean another ceremony. Keyed by identity, account and origin, in IndexedDB alongside the identity's own session. A record within five minutes of its expiry is not treated as usable, so a chain is never handed over that dies mid-request. The purge that already runs when an identity is discarded now takes these records with it, at the eight places that discard one. Leaving them would keep a chain for an identity the browser has forgotten. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sea-snake
force-pushed
the
fe/app-session-store
branch
from
August 22, 2026 19:49
1aad6be to
76c8818
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.
Design: #4224. Overview: #4230. Consumed by #4273, which stores a record, and #4248, which reads and discards one.
A session outlives the tab that created it. Without storing the chain, a sibling subdomain asking for the first time — or a user returning to a closed tab — would mean another ceremony, which is the cadence this design exists to remove.
Records keyed by identity, account and origin, in IndexedDB alongside the identity's own session.
A record within five minutes of its expiry is not treated as usable, so a chain is never handed over that dies mid-request. Five minutes is half the shortest session a caller can ask for, so a session near that floor is never answered from storage.
The purge that already runs when an identity is discarded now takes these records with it, at the eight places that discard one. Leaving them would keep a chain for an identity the browser has forgotten.
Three of the four exports have no caller here:
storeAppSessiongains one in #4273,appSessionsForOriginanddiscardAppSessionin #4248.purgeAppSessionsis called by this PR.Tests:
app-session.store.test.ts(7): storage keyed by identity, account and origin; a record for another origin not served; an expiring record not served; and the purge removing them.