Files
romm/backend/tests/endpoints
Sam Dornan 97a1ad2399 fix(activity): send play activity only to users who can see the ROM
activity:update and activity:clear went to every socket on /ws. The
connect handler accepts sockets with no login, so anyone could watch who
was playing what, with names and avatars, and a user with a ROM hidden
(directly, by platform, or by age rating) still saw sessions on it,
which GET /api/activity filters out.

Each event now goes to the user:{id} rooms of the enabled users who can
see its ROM, the room every logged-in socket joins on connect; nothing
is sent when no one can. Tests cover the audience across hidden ROMs,
hidden platforms, age limits, disabled users and clears.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PU9EuYhLpqR1DGMtmymr79
2026-10-04 17:06:40 +00:00
..
2026-03-14 23:56:46 -04:00