fix(client): clear gateway status from welcome identity
The client initialized gateway connectivity from ServerWelcome, but welcome only exposed a boolean. If a gateway disconnected before the client saw the catch-up PeerJoined event, the later unknown PeerLeft could not be tied to the gateway and the status could stay connected. Carry an optional gateway peer id in ServerWelcome. The relay fills it from the joining gateway or the existing room gateway, and the Windows client stores it so a matching unknown PeerLeft clears gateway connectivity. The boolean remains for wire compatibility with older welcomes that do not carry the id. Test Plan: - cargo fmt --check - cargo test -p lanparty-ctrl server_welcome - cargo test -p lanparty-relay accepts_gateway_and_client_into_room - cargo test -p lanparty-relay reports_missing_gateway_to_client_joining_first - cargo test -p lanparty-client-win relay_lifecycle - cargo test -p lanparty-client-win \ clears_gateway_status_when_welcome_gateway_leaves_before_join_event - cargo test -p lanparty-relay bridges_real_client_and_gateway_sessions - cargo test -p lanparty-client-core connects_to_relay_control_stream_as_client - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings - cargo build --release -p lanparty-relay -p lanparty-gateway - git diff --check - git diff --cached --check Refs: MVP lifecycle cleanup
This commit is contained in:
@@ -921,6 +921,7 @@ mod tests {
|
||||
assert_eq!(client.welcome().room_id(), 7);
|
||||
assert_eq!(client.welcome().peer_id(), 2);
|
||||
assert!(!client.welcome().gateway_connected());
|
||||
assert_eq!(client.welcome().gateway_peer_id(), None);
|
||||
assert!(client.quic_max_datagram_size() <= 1400);
|
||||
assert!(client.quic_diagnostics().datagram_supported());
|
||||
assert_eq!(
|
||||
|
||||
Reference in New Issue
Block a user