BlueGit

ict rusty-teams

fix(browser): recheck the quiet period before parking the Teams tab

- a wake during the MSAL probe no longer gets parked at once
- try_update instead of the deprecated fetch_update

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-11-18 · 13 days ago

Hash
9d7fc701b31714d3c0a1ee7c9d0a3f1d9cf63703
Parent
d0b90869
1 file changed +2 −2
crates/app/src/linux_park.rs +2 −2
@@ -47,7 +47,7 @@ impl ParkClock {
47 47 } else {
48 48 let _ = self
49 49 .holds
50 .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |holds| {
50 .try_update(Ordering::SeqCst, Ordering::SeqCst, |holds| {
51 51 Some(holds.saturating_sub(1))
52 52 });
53 53 }
@@ -71,7 +71,7 @@ pub fn spawn(clock: Arc<ParkClock>, browser: browser::Browser, endpoint: &str) {
71 71 continue;
72 72 }
73 73 // False for a parked tab, a login page and a Teams that has not signed in yet.
74 if !browser.teams_has_msal_cache().await {
74 if !browser.teams_has_msal_cache().await || !clock.due(Instant::now()) {
75 75 continue;
76 76 }
77 77 match park(&transport).await {
@@ -47,7 +47,7 @@ impl ParkClock {
47 } else {
47 } else {
48 let _ = self
48 let _ = self
49 .holds
49 .holds
50 .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |holds| {
50 .try_update(Ordering::SeqCst, Ordering::SeqCst, |holds| {
51 Some(holds.saturating_sub(1))
51 Some(holds.saturating_sub(1))
52 });
52 });
53 }
53 }
@@ -71,7 +71,7 @@ pub fn spawn(clock: Arc<ParkClock>, browser: browser::Browser, endpoint: &str) {
71 continue;
71 continue;
72 }
72 }
73 // False for a parked tab, a login page and a Teams that has not signed in yet.
73 // False for a parked tab, a login page and a Teams that has not signed in yet.
74 if !browser.teams_has_msal_cache().await {
74 if !browser.teams_has_msal_cache().await || !clock.due(Instant::now()) {
75 continue;
75 continue;
76 }
76 }
77 match park(&transport).await {
77 match park(&transport).await {