Devserver: support RESUME so a gateway drop during a call can be tested end to end #146

Open
opened 2026-11-12 01:22:26 +00:00 by charles · 0 comments
Owner

Found while building Voice 26 (#87, acceptance), on branch voice-26-acceptance (base eb88cd0).

The plan's acceptance test asks for "gateway drop and resume" while in voice. The devserver cannot do that over a real socket:

  • crates/fluxer-devserver/README.md: RESUME is answered with INVALID_SESSION false because sessions are not kept.
  • crates/fluxer-devserver/src/voice.rs session_closed: when a gateway session ends, its voice connections leave (state with channel_id: null).

So after a dropped socket the client re-identifies, re-sends op 4 with its old connection_id (fluxer-core voice/connection.rs resend_state) and the devserver answers VOICE_CONNECTION_NOT_FOUND; nothing else can be tested. There is also no test hook to drop the client's socket.

apps/fluxer/tests/voice_acceptance.rs therefore injects GatewayState::Reconnecting/Resuming, GatewayEvent::Resumed and GatewayState::Ready into the store, and checks that the op 4 that follows goes over the real socket and is confirmed by the devserver with the same connection_id, while the room stays up.

To do:

  1. Devserver: keep a closed session (its sequence and its voice connections) for a resume window; answer RESUME with RESUMED and replay missed dispatches; end the voice connections only when the window runs out.
  2. A test hook to drop the client's gateway socket (for example VoiceScript::drop_sessions() or a DevServer method).
  3. Replace the injected events in voice_session_end_to_end with a real drop.

Related live question (acceptance checklist item 11): what the real server does with the voice connection of a session that could not be resumed. If it drops it, the client goes to "Connection failed" instead of rejoining on its own (connection_is_gone in voice/connection.rs).

Found while building Voice 26 (#87, acceptance), on branch `voice-26-acceptance` (base `eb88cd0`). The plan's acceptance test asks for "gateway drop and resume" while in voice. The devserver cannot do that over a real socket: - `crates/fluxer-devserver/README.md`: RESUME is answered with INVALID_SESSION `false` because sessions are not kept. - `crates/fluxer-devserver/src/voice.rs` `session_closed`: when a gateway session ends, its voice connections leave (state with `channel_id: null`). So after a dropped socket the client re-identifies, re-sends op 4 with its old `connection_id` (`fluxer-core` `voice/connection.rs` `resend_state`) and the devserver answers `VOICE_CONNECTION_NOT_FOUND`; nothing else can be tested. There is also no test hook to drop the client's socket. `apps/fluxer/tests/voice_acceptance.rs` therefore injects `GatewayState::Reconnecting/Resuming`, `GatewayEvent::Resumed` and `GatewayState::Ready` into the store, and checks that the op 4 that follows goes over the real socket and is confirmed by the devserver with the same `connection_id`, while the room stays up. To do: 1. Devserver: keep a closed session (its sequence and its voice connections) for a resume window; answer RESUME with RESUMED and replay missed dispatches; end the voice connections only when the window runs out. 2. A test hook to drop the client's gateway socket (for example `VoiceScript::drop_sessions()` or a `DevServer` method). 3. Replace the injected events in `voice_session_end_to_end` with a real drop. Related live question (acceptance checklist item 11): what the real server does with the voice connection of a session that could not be resumed. If it drops it, the client goes to "Connection failed" instead of rejoining on its own (`connection_is_gone` in `voice/connection.rs`).
charles added this to the Voice milestone 2026-11-12 01:22:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#146
No description provided.