From 76c08a3b768af4c9574c3c74570bb4d355e0ef5c Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Mon, 26 Oct 2026 02:32:26 -0400 Subject: [PATCH] ci(smoke): wait for the keychain strip before judging #105 step 2 Step 2 mirrors the tokens, reads them back, then strips them from localStorage in the same boot. The check stopped at the first "mirrored" sighting, so a step-2 build could be reported as "before step 2" (n/a). Wait up to 30 s for tokensIn === keychain; only call it n/a if it is still mirrored-only after that. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5 --- scripts/windows-smoke.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/windows-smoke.mjs b/scripts/windows-smoke.mjs index c2b5636..2f08e1a 100644 --- a/scripts/windows-smoke.mjs +++ b/scripts/windows-smoke.mjs @@ -406,11 +406,16 @@ record( try { await page.evaluate(([k, f]) => localStorage.setItem(k, JSON.stringify(f)), [KEY, fake]); await page.reload(); - const moved = await until(async () => { + // Step 2 mirrors the tokens, reads them back to verify, and only then strips + // them from localStorage, all in the same boot. Wait for the strip rather + // than stopping at the first "mirrored" sighting (that in-between state made + // a step-2 build look like a step-1 one). + const stripped = await until(async () => { const st = await state(); - return st.tokensIn === 'keychain' || (st.blobHasToken && st.kcToken === fake.accessToken) ? st : undefined; + return st.tokensIn === 'keychain' ? st : undefined; }, 30_000); - if (moved && moved.tokensIn !== 'keychain') { + const moved = stripped ?? (await state()); + if (!stripped && moved.blobHasToken && moved.kcToken === fake.accessToken) { record(name, 'n/a', 'build mirrors the tokens but keeps them in localStorage (before step 2)'); } else { await page.reload();