Files
amethyst/commons
Claude f670724cd8 fix: drop unresponsive group-call peers on callee side after 30 s
When a caller invites a group and one of the members never answers,
the caller already drops the unresponsive peer after 30 s (via the
per-peer watchdog in CallManager). The hangup the caller publishes is
addressed only to the unresponsive peer, so the OTHER participants
never learn that the peer is out and keep waiting for them forever.

Mirror the caller's 30 s budget on the callee side. In acceptCall,
split the group members into:

- peerPubKeys: the caller (they sent us the offer) plus any peers
  whose answer we observed while still ringing. These are confirmed
  to be in the call.
- pendingPeerPubKeys: everyone else we haven't heard from yet. Each
  gets a local watchdog timer; if we never observe them (via a mesh
  answer or a mid-call offer) within 30 s they are silently dropped
  from our local state.

Because the callee is not the peer's inviter, handlePeerTimeout must
NOT publish a CallHangup in this path — terminating the invitee's
ringing is the caller's responsibility. Track "who we invited" in a
peersInvitedByUs set so the caller-side path (beginOffering,
initiateCall, invitePeer) still publishes the hangup, while the new
callee-side watchdog path drops the peer silently.

Also move a pending peer into peerPubKeys and cancel their watchdog
when they send us a mid-call mesh offer — the offer is proof they're
in the call, so we should not wait further.

Adds three new tests (callee watchdog drops pending peer, mid-call
offer transitions pending peer, watchdog is cancelled on answer from
pending peer) and updates two existing tests for the new Connecting
state shape when a group call is accepted.
2026-04-15 14:36:02 +00:00
..
2026-04-06 09:22:21 -04:00