-
Notifications
You must be signed in to change notification settings - Fork 0
Guard session establishment and restore against logout or newer identity operations #3324
Copy link
Copy link
Labels
Priority IIThe active direction's next tranche: wedge capabilities, significant defects, near-term hardening.The active direction's next tranche: wedge capabilities, significant defects, near-term hardening.bugSomething isn't workingSomething isn't workingfrontendPrimary implementation impact in Vue/TypeScript UI and client runtime.Primary implementation impact in Vue/TypeScript UI and client runtime.securityAuthentication, authorization, data protection, abuse prevention, and compliance-related changes.Authentication, authorization, data protection, abuse prevention, and compliance-related changes.
Description
Activity
Metadata
Metadata
Assignees
Labels
Priority IIThe active direction's next tranche: wedge capabilities, significant defects, near-term hardening.The active direction's next tranche: wedge capabilities, significant defects, near-term hardening.bugSomething isn't workingSomething isn't workingfrontendPrimary implementation impact in Vue/TypeScript UI and client runtime.Primary implementation impact in Vue/TypeScript UI and client runtime.securityAuthentication, authorization, data protection, abuse prevention, and compliance-related changes.Authentication, authorization, data protection, abuse prevention, and compliance-related changes.
Projects
- StatusShow more project fieldsDone
Finding
At main
307c3b8b50bec1cb0bfaea3e570a942bcb1d4451,sessionStore.tshas unowned asynchronous identity settlement:refreshSessionawaits the server and then callssetSessionunconditionally.setSessionawaitspurgeLegacyApiCachesand then writes all reactive identity fields plus token/session persistence, without rechecking the initiating identity operation.restoreSessioncaptures token/session storage, awaits cache purge and then restores those old values to reactive state without rechecking logout or a newer login.login, register and OAuth/OIDC exchange also have a pre-send cache-purge await and a post-response establishment await. Both boundaries need ownership, not just token-string comparison at the response.Executed supplementary reproductions
A local Node 22 VM probe executed the real
sessionStore.ts,tokenStorage.tsandjwt.tsusing minimal Pinia/Vue stand-ins and a controlled API/cache-purge boundary. A valid-token current-refresh positive control passed. Three assertions failed against main:This is control-flow evidence, not a full Vitest run, Vue reactivity proof, browser/server acceptance or Node-24 qualification. Preserve these schedules as real deferred-promise store tests before repairing.
Required contract
Introduce an explicit identity-operation generation/owner. Define latest-intent semantics across login, register, OAuth/OIDC exchange, silent refresh, restore, demo entry, clearSession and logout. Check ownership before transport after any pre-send purge and after every post-response/purge await. Old operations may not persist identity, reset current display-name caches, overwrite a newer error/loading state or issue a stale success toast. A current refresh/restore must still work; registration and consumed-auth-code messages must retain the distinction between server commit and browser establishment failure.
Accept tests for all three schedules above, A→B reverse responses, same-token re-login, failed newer operations, demo entry and stale finally/loading settlement. No mutation rollback, token revocation or cross-tab lifecycle guarantee should be inferred merely from refusing a stale local commit.
Scope and relationship
PR #3318 / issue #3317 owns shared HTTP 401 side effects and automatic retries, not successful session establishment. #3306 owns board-store session invalidation, not the canonical identity store. Keep this as a focused sibling repair rather than declaring either issue solved by the other.
Status: reproduced residual from the 2026-09-21 audit; not implemented or claimed complete. No new ownership lease is taken for sessionStore.ts by this issue.