Sign out never recovers when the logout request stalls

Aperta
#864 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, rust

Direzione di ricerca

Start in web/app.js at accountUpdatePending() and the lobby's /api/logout handler. Trace the session check and existing browser tests for logout, then reproduce a stalled POST /api/logout. Done when the wait is bounded, the page can report or check whether sign-out succeeded, and pending controls recover so the user can retry.

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

Descrizione

Observed behavior

The lobby's Sign out button posts to /api/logout and reloads the page only after that request settles. The request has no timeout, so when the server accepts the connection and never answers, the page never reloads and Sign out stays disabled. Nothing tells the candidate what happened, and the only way out is to reload by hand. Once #782 lands, Your recordings is inert for as long as the request is pending as well.

While the request is pending, Start interview and Delete saved reports stay enabled, because accountUpdatePending() in web/app.js does not cover a pending sign-out. Whether a click then succeeds depends on whether it reaches the server before the session row is deleted.

Expected behavior
  • The wait for /api/logout is bounded, for example with AbortSignal.timeout(requestTimeoutMs).
  • When the wait ends without a response, the lobby does not reload blindly: the browser has not received the Set-Cookie that clears the session, so a reload can come back signed in. It re-checks /api/session or shows that sign-out could not be confirmed, and Sign out can be pressed again.
  • The pending sign-out state is cleared on that path, so no control stays disabled or inert for good.
Reproduction
  1. Run a browser test (or devtools request blocking) that never answers POST /api/logout.
  2. Sign in, open the lobby and click Sign out.
  3. Wait past the timeout you expect. The page does not reload and Sign out stays disabled.
Notes

Raised in the review of #782, where the author kept the pull request to recording-link visibility. A timeout alone is not the fix, since an aborted request does not say whether the server finished the logout: the recovery path above is the part that needs a decision.

Lingua principale
Rust
Stelle
236
Fork
153
Merge medio
1g 9h
PR unite (30g)
187

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 sysprog21/codetrial

Tutte le issue di sysprog21/codetrial

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.