fix(release): drop the never-called clear from the chunk reload marker (Q-6.9-9)
Follow-up to 215cc54. The chunk store passed to the shared reload-once guard had a clear() that no path calls (chunk recovery has no coherent boot to clear on; its marker only expires), which dropped decide-chunk-recovery.ts to 75% function coverage against its 95% risk threshold. RecoveryMarkerStore.clear is now optional and the chunk store omits it; boot recovery still provides and uses it. Verified: test:coverage risk gate PASS (363/363 modules, 72 thresholds; it failed on this module before); all gates PASS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1e93d30d1f
commit
07937fa59c
@@ -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 }
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user