fix(cache): scope Evidence display refresh to matching snapshot bindings

This commit is contained in:
morluto committed 2026-10-24 01:47:30 +08:00
1 parent f8b65e7872
commit 8aa40e9a61
11 files changed
+327 -113

No files matched your search

@@ -150,8 +150,8 @@ export abstract class BinarySessionRecords {
): Result<number, EvidenceIntegrityError | AnalysisInputError> {
const imported = this.#records.mergeEvidenceBundle(bundle);
if (!imported.ok) return imported;
if (imported.value.metadataChanged) this.invalidateSnapshot();
else if (imported.value.changed) this.#emitSnapshotChanged();
this.#snapshot.refreshEvidenceDisplay(imported.value.replacements);
if (imported.value.changed) this.#emitSnapshotChanged();
return ok(imported.value.recordsAdded);
}
@@ -238,7 +238,9 @@ export abstract class BinarySessionRecords {
: { target: active.target, profile },
(bundle) => {
const imported = this.#records.mergeEvidenceBundle(bundle);
return imported.ok ? ok(imported.value.recordsAdded) : imported;
if (!imported.ok) return imported;
this.#snapshot.refreshEvidenceDisplay(imported.value.replacements);
return ok(imported.value.recordsAdded);
},
);
if (imported.ok) this.#emitSnapshotChanged();