feat(confidence-engine): persist canonical investigation state
This commit is contained in:
@@ -83,11 +83,17 @@ export function saveInvestigation(snapshot) {
|
||||
|
||||
// ── clearInvestigation ───────────────────────────────────────────────
|
||||
|
||||
/** Removes only the canonical investigation key. */
|
||||
/** Removes the canonical investigation key and the legacy session key. */
|
||||
export function clearInvestigation() {
|
||||
const storage = _getTargetStorage();
|
||||
if (!storage) return;
|
||||
try { storage.removeItem(CANONICAL_KEY); } catch (_) {}
|
||||
|
||||
// Also remove the legacy sessionStorage key so it cannot resurrect stale
|
||||
// state after loadInvestigation falls through from missing canonical key.
|
||||
const legacyStorage = _getLegacyStorage();
|
||||
if (!legacyStorage) return;
|
||||
try { legacyStorage.removeItem(LEGACY_KEY); } catch (_) {}
|
||||
}
|
||||
|
||||
// ── internals ────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user