Skip to content

Push feed socket stays open after the personal access token or bot token it was opened with is revoked #38877

Backlog

Description

@Vamsi-klu

With #38876 (the fix for #38245), a push feed socket opened without a session closes at the first sweep after its token's exp, and all of a user's sockets close when the user is deleted. One case is still open: revoking a single stored credential while its user stays.

Steps:

  1. Create a personal access token for a user (or generate a bot token).
  2. Open a push feed socket with it (/api/v1/push/feed, token in the handshake query).
  3. Revoke that token (PUT /v1/users/security/token/revoke, or PUT /v1/users/revokeToken for a bot).

Expected: the socket closes, the same way REST starts refusing the token right away.

Actual: the socket stays open until the token's exp. A token with Unlimited expiry keeps its socket open until the user is deleted, the provider changes, or the server restarts.

Why it was left out of #38245: the socket does not know which stored credential it was opened with. A fix would stamp a credential reference (not the token) at the handshake, the same way TokenExpiresAt is stamped today, and either close the matching sockets when Credentials.changed fires or have the sweep ask the per server verifier whether that credential is still current. Revocation already reaches peers through the credential pub/sub type, so the cross pod part exists.

Related: #38245, #38876, ADR "A push feed socket without a session ends when its token expires or its user is deleted".

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

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions