fix(ext/sw): clear state.gitHost on session expiry (Plan C Phase 5)
DEV-C P2: expiry cleared manifest but left the cached git-host client. The initializer rebuilds gitHost on demand, so clearing here is safe. No new test: index.ts has top-level chrome.* side effects that make it expensive to import in a unit test, and the change is a one-liner state mutation in an inline callback. Manually verified by tracing call sites. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,9 @@ sessionTimer.onExpired(() => {
|
||||
console.log('[relicario sw] session expired — locking vault');
|
||||
clearCurrent();
|
||||
state.manifest = null;
|
||||
// Plan C Phase 5: don't leak the cached git-host client across a lock.
|
||||
// The initializer rebuilds gitHost on demand, so clearing here is safe.
|
||||
state.gitHost = null;
|
||||
// Best-effort broadcast — receiver may not exist yet.
|
||||
chrome.runtime.sendMessage({ type: 'session_expired' }).catch(() => {});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user