fix: restore timed break after unchanged fresh context (Closes #1262)
This commit is contained in:
parent
76f89df609
commit
e06bd8435d
|
|
@ -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) {
|
if (snapshot.context && workChanged) {
|
||||||
setOfflineWorkMode(false);
|
setOfflineWorkMode(false);
|
||||||
const retainedPlanningLogin = !snapshot.context.error ?
|
const retainedPlanningLogin = !snapshot.context.error ?
|
||||||
|
|
@ -5463,16 +5475,6 @@
|
||||||
laterSync.migrate(laterWork.read());
|
laterSync.migrate(laterWork.read());
|
||||||
laterSync.flush();
|
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;
|
snapshot.context.notifications = lastNotifications;
|
||||||
renderContextSnapshot(snapshot.context);
|
renderContextSnapshot(snapshot.context);
|
||||||
if (contextFreshness?.stale) markMyWorkStale();
|
if (contextFreshness?.stale) markMyWorkStale();
|
||||||
|
|
|
||||||
|
|
@ -267,6 +267,20 @@ restoring.then(result => {{
|
||||||
assert "timerView.restore(todaySync.flush());" in dashboard
|
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():
|
def test_timed_break_is_packaged_as_an_accessible_mobile_flow():
|
||||||
html = (ROOT / "frontend" / "index.html").read_text()
|
html = (ROOT / "frontend" / "index.html").read_text()
|
||||||
css = (ROOT / "frontend" / "dashboard.css").read_text()
|
css = (ROOT / "frontend" / "dashboard.css").read_text()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user