fix(ext/sw): null gitHost on explicit lock (Plan C Phase 6)

The explicit lock message handler nulled state.manifest but left
state.gitHost (now carrying the cached lastSyncAt) intact, so a lock then
re-unlock within one service-worker lifetime surfaced a stale sync time.
Null gitHost here too — symmetric with the session-expiry path (index.ts)
and completing Plan C Phase 5's don't-leak-git-host-across-a-lock intent;
unlock rebuilds it on demand.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-05-31 22:11:02 -04:00
parent f4b4cf3db7
commit 675452a9ef

View File

@@ -59,6 +59,9 @@ export async function handle(
case 'lock':
session.clearCurrent();
state.manifest = null;
// Don't leak the cached git-host (incl. lastSyncAt) across a lock —
// symmetric with the session-expiry path (index.ts); unlock rebuilds it.
state.gitHost = null;
return { ok: true };
case 'list_items': {