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>
@@ -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 _ = self48
let _ = self49
.holds49
.holds50
.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 {