From 11514ea37d1e80d75bf2c1ba332bbd68fac5db4e Mon Sep 17 00:00:00 2001 From: vtroc7 Date: Wed, 30 Sep 2026 20:23:24 +0300 Subject: [PATCH] Keep relayed matches through short link loss; stop browser polling in a lobby Co-Authored-By: Claude Opus 5.5 --- crates/net/src/client/runtime.rs | 3 ++- crates/net/src/transport/master.rs | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/net/src/client/runtime.rs b/crates/net/src/client/runtime.rs index 4832a6d..5c74675 100644 --- a/crates/net/src/client/runtime.rs +++ b/crates/net/src/client/runtime.rs @@ -1203,7 +1203,8 @@ pub const BACKLOG_STALL_MS: i32 = 1000; /// How many stalls the link may take before the session is failed for real. A /// hitch costs one and is recovered from; an authority that has genuinely gone /// away keeps earning them and fails once they add up. -pub const BACKLOG_STALLS_BEFORE_FAIL: u32 = 3; +pub const BACKLOG_STALLS_BEFORE_FAIL: u32 = + (master_protocol::SESSION_IDLE.as_millis() / BACKLOG_STALL_MS as u128) as u32 - 1; #[derive(Debug, Default)] pub struct BacklogStalls { diff --git a/crates/net/src/transport/master.rs b/crates/net/src/transport/master.rs index 44c8763..3cb3936 100644 --- a/crates/net/src/transport/master.rs +++ b/crates/net/src/transport/master.rs @@ -840,12 +840,15 @@ fn arm_master_browser( browser: Option>, mut commands: Commands, ) { + let MasterLaunchMode::Browser(browser_config) = &intent.0 else { + if browser.is_some() { + commands.remove_resource::(); + } + return; + }; if browser.is_some() { return; } - let MasterLaunchMode::Browser(browser_config) = &intent.0 else { - return; - }; let state = Arc::new(Mutex::new(MasterBrowserSnapshot { loading: true, have: browser_config.have,