feat: CI regression: mobile Today break status is lost after recovery reload #1263

Merged
rockachopa merged 1 commits from timmy/1262-ci-regression-mobile-today-break-status-is-lost- into main 2026-08-22 12:26:37 +00:00
2 changed files with 26 additions and 10 deletions

View File

@ -5450,6 +5450,18 @@
});
}
}
if (snapshot.context) {
const contextIdentityFresh = !snapshot.context.error && !contextFreshness?.stale &&
!contextFreshness?.degraded && !contextFreshness?.revalidating;
activeFlushLogin = contextIdentityFresh ? String(snapshot.context.user?.login || '').trim() : '';
if (activeFlushLogin) {
confirmedOwnerLogin = activeFlushLogin;
timerView.restore(todaySync.flush());
restoreReleaseReceipt();
updateDeliveryReceiptControls();
interruptionPrompt.restore();
}
}
if (snapshot.context && workChanged) {
setOfflineWorkMode(false);
const retainedPlanningLogin = !snapshot.context.error ?
@ -5463,16 +5475,6 @@
laterSync.migrate(laterWork.read());
laterSync.flush();
}
const contextIdentityFresh = !snapshot.context.error && !contextFreshness?.stale &&
!contextFreshness?.degraded && !contextFreshness?.revalidating;
activeFlushLogin = contextIdentityFresh ? String(snapshot.context.user?.login || '').trim() : '';
if (activeFlushLogin) {
confirmedOwnerLogin = activeFlushLogin;
timerView.restore(todaySync.flush());
restoreReleaseReceipt();
updateDeliveryReceiptControls();
interruptionPrompt.restore();
}
snapshot.context.notifications = lastNotifications;
renderContextSnapshot(snapshot.context);
if (contextFreshness?.stale) markMyWorkStale();

View File

@ -267,6 +267,20 @@ restoring.then(result => {{
assert "timerView.restore(todaySync.flush());" in dashboard
def test_fresh_unchanged_context_restores_the_confirmed_break_owner():
dashboard = (ROOT / "frontend" / "dashboard.js").read_text()
snapshot_handler = dashboard.split("async function renderLiveSnapshot", 1)[1]
identity_restore, changed_render = snapshot_handler.split(
"if (snapshot.context && workChanged)", 1
)
assert "activeFlushLogin = contextIdentityFresh ?" in identity_restore
assert "confirmedOwnerLogin = activeFlushLogin;" in identity_restore
assert "timerView.restore(todaySync.flush());" in identity_restore
assert "activeFlushLogin = contextIdentityFresh ?" not in changed_render.split(
"if (eventsChanged", 1
)[0]
def test_timed_break_is_packaged_as_an_accessible_mobile_flow():
html = (ROOT / "frontend" / "index.html").read_text()
css = (ROOT / "frontend" / "dashboard.css").read_text()