diff --git a/src/application/use-cases/decide-chunk-recovery.ts b/src/application/use-cases/decide-chunk-recovery.ts index 6ca4326a..9e68ae35 100644 --- a/src/application/use-cases/decide-chunk-recovery.ts +++ b/src/application/use-cases/decide-chunk-recovery.ts @@ -38,7 +38,8 @@ export function decideChunkRecovery( `->${input.activeBuildId}/${input.activeReleaseId}`; // Q-6.9-9. The boot reload guard's rule: at most one automatic reload per // marker TTL, whatever the pair. A pair-keyed marker let replicas that - // alternate A/B reload on every chunk failure. + // alternate A/B reload on every chunk failure. The marker is never cleared; + // it only expires. const decision = createReloadOnceGuard({ read() { const guard = input.storage.read("CHUNK_RELOAD_GUARD"); @@ -50,9 +51,6 @@ export function decideChunkRecovery( throw new Error("chunk reload guard was not persisted"); } }, - clear() { - input.storage.remove("CHUNK_RELOAD_GUARD"); - }, }).decide(releasePair); return decision === "reload-once" ? { action: "reload-once", releasePair } diff --git a/src/platform/release/release-mismatch-recovery.ts b/src/platform/release/release-mismatch-recovery.ts index 69f466f0..1b5efcf5 100644 --- a/src/platform/release/release-mismatch-recovery.ts +++ b/src/platform/release/release-mismatch-recovery.ts @@ -19,7 +19,8 @@ export type RecoveryMarkerStore = Readonly<{ read(): string | null; write(value: string): void; - clear(): void; + /** Absent for a marker that only expires (chunk recovery never clears). */ + clear?(): void; }>; export type ReleaseMismatchDecision = "reload-once" | "show-failure"; @@ -97,7 +98,7 @@ export function createReloadOnceGuard( }, clear(): void { try { - store?.clear(); + store?.clear?.(); } catch { // A stale marker only means the next mismatch shows the failure. }