Skip to content

Sign out never recovers when the logout request stalls #864

Backlog

Description

@jserv

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions