Andrey Antukh 606d68e2b4 🐛 Add failing tests for websocket subscription revocation
GHSA-m53j-2766-6jqw. A websocket subscription checks read permission
once, at subscribe time, then relays every message published to the
topic for the rest of the connection's life. A member whose access is
revoked keeps receiving live file content as long as the tab stays
open, because nothing re-checks the permission.

These tests reproduce the leak against the real message bus, so the
failure is observed end to end rather than assumed:

- revoked-member-stops-receiving-file-changes: after delete-team-member
  the socket still receives the :file-change diff.
- revoked-member-stops-receiving-library-changes: leave-team keeps the
  team subscription alive, leaking :library-change diffs.
- role-downgrade-keeps-revocation-irrelevant: a downgrade to :viewer
  keeps read access, so the subscription must survive it. Guards
  against a fix that closes subscriptions too eagerly.

The two revocation tests fail on the current code; the role test
passes and pins the behavior a fix must not break.

Closes #12155

AI-assisted-by: space-bunny-free
2026-10-08 13:08:50 +02:00
..
2026-09-29 09:07:34 +02:00
2026-10-06 15:12:15 +02:00
2026-10-06 15:12:15 +02:00
2024-05-29 19:05:04 +02:00