You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(menubar): preserve settling deadline on re-entry; end settling on layout reset
Two follow-up fixes from code review of the startup settling period:
**Preserve settling deadline on performSetup() re-entry (HIGH)**
Replace the `Duration`-based `Task.sleep(for:)` with a deadline-based
`Task.sleep(until:clock:.continuous)` anchored to a stored
`settlingDeadline: ContinuousClock.Instant?`.
On re-entry, the new deadline is `max(existingDeadline, newDeadline)`,
so a second performSetup() call that fires after systemUptime crosses the
60 s boundary can no longer silently truncate the original 30-second login
settling window to 5 seconds. On normal completion, `settlingDeadline` is
nil'd so subsequent sessions start fresh.
**End settling immediately on user-initiated layout reset (MEDIUM)**
`resetLayoutToFreshState()` now cancels `startupSettlingTask` and clears
both `isInStartupSettling` and `settlingDeadline` at the top of the
function. A user-initiated reset is authoritative: the post-reset cache
must be free to run `saveSectionOrder()` and restore logic without being
blocked by a settling period that was started before the reset.
0 commit comments