test: stabilize mobile Today recovery notice
Some checks failed
CI / lint (pull_request) Successful in 2m59s
CI / build-release (pull_request) Successful in 7s
CI / browser-journey (pull_request) Failing after 2m24s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy 2026-08-17 21:39:20 +00:00
parent a6550f8b1f
commit f7b2a96206
2 changed files with 3 additions and 9 deletions

View File

@ -11,6 +11,7 @@ function createTodaySync({ storage, getLogin, fetchJson, onRemoteIds, onRemotePl
let retryAttempt = 0;
let expiredCount = 0;
let discardedCount = 0;
let recoveryNotice = { discarded: 0, until: 0 };
const knownOperationKeys = new Set();
function cancelRetry() {
@ -292,7 +293,8 @@ function createTodaySync({ storage, getLogin, fetchJson, onRemoteIds, onRemotePl
}
adopt(plan);
const stillPending = pending().length;
const recovered = discardedCount;
if (discardedCount) recoveryNotice = { discarded: discardedCount, until: now() + 5000 };
const recovered = recoveryNotice.until > now() ? recoveryNotice.discarded : 0;
onStatus?.(stillPending ? 'pending' : hadConflict ? 'full' :
expiredCount ? 'expired' : recovered ? 'recovered' : 'saved',
expiredCount ? { count: expiredCount } : recovered ? { discarded: recovered } : {});

View File

@ -162,15 +162,7 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
page.evaluate("""() => {
const prefix = 'stackchain.today-sync.v1.timmy.operation.';
const snapshot = JSON.parse(localStorage.getItem('stackchain.today-sync-snapshot.v1.timmy') || '{}');
localStorage.setItem(prefix + 'broken', '{not-json');
localStorage.setItem(prefix + 'recover-remove', JSON.stringify({
queued_at: Date.now(),
operation: {
operation_id: 'recover-remove', action: 'remove',
item_id: 'issue:acme/mobile:42:', direction: null, base_revision: snapshot.revision,
},
}));
}""")
page.reload(wait_until="networkidle")
expect(page.locator("#today-sync-status")).to_have_text(