Sign-out: reach other tabs when storage refuses the sign-out's writes even after the wipe

Aperta
#1,960 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Start with the API explorer section of DESIGN.md and the sign-out code that writes Studio:ExplorerAuthEpoch and Studio:AppSignOut to localStorage, as described in #1956. Before any change, decide whether a BroadcastChannel fallback is worth its partial coverage, since the issue itself calls that a design call. Done means that decision is recorded and, if approved, the live-tab path is specified and tested.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

A sign-out reaches other tabs through localStorage. It bumps the API explorer's sign-out generation (Studio:ExplorerAuthEpoch) and writes the Studio:AppSignOut announcement. #1956 makes both survive the sign-out's own storage wipe, and retries each once after the wipe has made room. Two cases are left for a store that refuses even that retry:

  1. Generation refused twice. If both the collapse and its retry are refused, the old generation stays current. A tab that missed the live event and reloads keeps an explorer credential stamped before the sign-out. This tab writes the owed collapse on its next entity sign-out, but a reload forgets that it is owed.
  2. Announcement refused twice. It is never sent. #1956 does this on purpose: an announcement sent late could end a session the user has signed back into in another tab (see the API explorer section of DESIGN.md).

Both need a store that refuses writes right after it has been emptied, such as a broken quota, a storage policy, or a private-mode quirk. Neither happens on a normal sign-out.

  1. A sign-in marker refused twice (from #1969). If storage refuses both removing and blanking a signed-out entity's marker, #1969 retries the removal later. If another tab signed in again at the same URL in the meantime, the retry can delete that new marker, because the stored value is the same either way. When the refused value couldn't be read, the retry deletes whatever is stored. Either way the entity just looks signed out on the next load.

Possible fix

Add a second cross-tab channel for when storage refuses every write, for example a BroadcastChannel the sign-out posts to. It reaches tabs that are running, not tabs that are reloading, so it covers the live path only. A durable fix for a store that won't take writes may not exist. Whether a new channel is worth that partial coverage is a design call.

Review-Deferral: 22601929e2fc387e severity=nit category=security
Review-Deferral: 6f2a8235a818a050 severity=nit category=reliability
Review-Deferral: a09380796d04a58f severity=nit category=data-integrity

Raised by the cross-model review of #1956 (#1946).

🤖 Generated by Anthropic Claude Code (Claude Opus 5.5); posted via @dawsontoth.

Lingua principale
TypeScript
Stelle
5
Fork
4
Merge medio
1g 19h
PR unite (30g)
144

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HarperFast/studio

Tutte le issue di HarperFast/studio

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.