diff --git a/prototype/channel-native/src/peer/transport.rs b/prototype/channel-native/src/peer/transport.rs index 8f26a1835..a80d0df98 100644 --- a/prototype/channel-native/src/peer/transport.rs +++ b/prototype/channel-native/src/peer/transport.rs @@ -1886,6 +1886,9 @@ impl Engine { while self.turn_setup.try_recv().is_ok() {} self.close_turn(); self.discovery_routes.clear(); + // Closed before the last drain: an SDK we disconnected has no send consent, + // and that must not be read as a failed path. + self.state.store(PeerState::Closed as u8, Ordering::Release); self.rtc.disconnect(); self.drain(); self.udp_send_failures