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
An open preview stream outlives its session's revocation #798
A preview tab's stream socket stays open after the session that opened it is revoked. Someone whose level is lowered or removed while they watch a tab keeps receiving its page and can still click and type in it, until the tab closes or they disconnect. People and access AC17 says a lowered level takes effect at once, on open connections too; AC49 says an ended device stays ended.
Why: the RPC socket races its handler against sessions.awaitInvalidation(session.sessionId) (apps/server/src/ws.ts, around line 3264), so a revoked session's /ws closes at once. Access.ts relies on that. Upstream's preview stream handler (apps/server/src/preview/ServerBrowserStream.ts, the /api/preview-stream/ws upgrade) checks the session only when it opens and never watches for invalidation. canOperate is also fixed when the socket opens.
Scope: the gap is upstream's and already applies to every session that can stream, such as a device revoked from Connections settings. #797 (for #796) extends it to Collaborators on a thread or project, who are the people most likely to be demoted while watching.
Fix: race the viewer loop in ServerBrowserStream.ts against awaitInvalidation, as ws.ts does. That is an edit to an upstream-owned file: record it in FORK.md, and offer it upstream, since it fixes the same gap there.
Reproduced live on #797 at f39f404, twice. A thread Collaborator opened /api/preview-stream/ws from a Node client, then the Owner lowered them to Viewer, which revoked their session. The socket kept streaming frames for over two minutes, took control, and clicked the page: the Owner's view of the page went from 2 clicks to 3. The ordinary web client isn't affected, because its page reloads when the session is renewed and the new session is refused. Only a client that holds the socket open keeps it.
Activity
Jacksondr5 commentedon Oct 29, 2026
Reproduced live on #797 at f39f404, twice. A thread Collaborator opened
/api/preview-stream/wsfrom a Node client, then the Owner lowered them to Viewer, which revoked their session. The socket kept streaming frames for over two minutes, took control, and clicked the page: the Owner's view of the page went from 2 clicks to 3. The ordinary web client isn't affected, because its page reloads when the session is renewed and the new session is refused. Only a client that holds the socket open keeps it.docs(j5): keep the #798 link and give-back note out of D33's body
fix(preview): close streams when their session is invalidated (#802)