Cover the 1:1 ring and huddle WS handlers (LC-614) #573
Loading…
Reference in a new issue
No description provided.
Delete branch "test/lc614-call-huddle-coverage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes LC-614. The prerequisite for LC-613 (converge call.js/voice.js) and LC-615 (the SFU handover).
Why now
The ringing slot,
relay_call_signal, andhandle_voice_join/handle_voice_leavehad no direct tests - only indirect exercise through the transcription and ring suites. LC-596 AC4 requires the DM 1:1 path to keep its behaviour while LC-613 and LC-615 refactor exactly this code. Refactoring untested real-time signaling with a correctness requirement on it is the wrong order; this lands the net first.How the internals are reached
relay_call_signal,handle_voice_join, andhandle_voice_leavelive in the WS receive loop. I did not build a WebSocket upgrade + framing harness - that would test axum's plumbing more than this logic, and would be flakier. Instead they are re-exposed through a labelledroutes::test_supportmodule, using the samepub use ws::...pattern the crate already uses forrender_new_message_or_bump. The router never routes there; the only production edit is widening three fns from private topub.call_ring.rsStarted; same caller again ->DuplicateSelf; clear releases it; glare resolves to the first caller, and the winner's own payload is replayed to the loser, not the loser'shuddle.rsVoiceRoster, and announcesVoiceJoinedto existing participantsVoiceLeftand removes the user; leave on a never-registered connection is a no-op that disturbs nobodyProven non-vacuous
Every assertion that matters was shown failing against a deliberate break before it counted:
a_block_in_either_direction_kills_signalingfailsStartedinstead ofGlare->ringing_slot_resolves_glare_to_the_first_callerfailshandle_voice_join->join_is_refused_for_a_room_the_user_cannot_accessfailsEach break failed only its own test.
Not covered, on purpose
Instant::now()with no injectable clock, so testing it means either waiting 60s or adding a time seam. Not worth either here; flagged for whoever touches the slot next.transcripts.rs.Full suite green (184 test binaries, up from 182),
just checkclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01FhDVMViNHqUbwmfe2aXTv5