You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Push feed socket stays open after the personal access token or bot token it was opened with is revoked #38877
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:
Create a personal access token for a user (or generate a bot token).
Open a push feed socket with it (/api/v1/push/feed, token in the handshake query).
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".
Activity