Files
hermes-agent/apps
kshitijk4poor 4ed14253ea perf(bots): one groups.changed on every open socket is one room read
Follows #149210. A window holds several sockets to one backend (the primary,
the room's lease, others), and _broadcast_global_event writes the same
groups.changed frame to each, so every push queued one extra groups.state
read that found nothing new (live: 30 state reads for 15 pushes).

- The change watcher stamps each groups.changed with broadcast_id: the
  process's replay epoch (the token gateway.ready already carries) and a
  counter, unique for the process's life.
- The room view skips a push whose broadcast_id it already read for (the
  SDK's LruCache, last 64). A push without one (an older backend) reads as
  before.

Copies are told apart by identity, not timing: a later broadcast with the
same rooms, or another backend's, always reads.

Also, from the #149210 review: groups.state's change_events flag (it moves
the view to the 15 s backstop) is now pinned by a test, and the check that the
room service's status sets match the driver's shown rows moves from an
import-time assert to a test.
2026-11-11 16:53:19 +05:30
..