diff --git a/js/historyView.js b/js/historyView.js index 1bf8082b..bb5e58e8 100644 --- a/js/historyView.js +++ b/js/historyView.js @@ -572,7 +572,9 @@ export function createWatchHistoryRenderer(config = {}) { }); return engine.run("watch-history", { runtime }); } - const items = await watchHistoryService.loadLatest(actorInput); + const items = await watchHistoryService.loadLatest(actorInput, { + allowStale: true, + }); const normalized = normalizeHistoryItems(items); return { items: normalized, metadata: { engine: "service-fallback" } }; }, diff --git a/js/watchHistoryService.js b/js/watchHistoryService.js index a201cd6f..e40f855d 100644 --- a/js/watchHistoryService.js +++ b/js/watchHistoryService.js @@ -1250,7 +1250,10 @@ async function loadLatest(actorInput, options = {}) { const normalizedOptions = options && typeof options === "object" ? options : {}; - const allowStale = normalizedOptions.allowStale !== false; + // Only callers that can react to a later fingerprint update should opt into + // stale cache reads; everyone else waits for the fresh list so they do not + // miss entries. + const allowStale = normalizedOptions.allowStale === true; if (!isFeatureEnabled(actorKey)) { if (!state.restored) { diff --git a/tests/watch-history.test.mjs b/tests/watch-history.test.mjs index 56a201b0..b913154e 100644 --- a/tests/watch-history.test.mjs +++ b/tests/watch-history.test.mjs @@ -1061,7 +1061,9 @@ async function testWatchHistoryStaleCacheRefresh() { return refreshedItems; }; - const staleResult = await watchHistoryService.loadLatest(actor); + const staleResult = await watchHistoryService.loadLatest(actor, { + allowStale: true, + }); assert.equal( resolveCallCount, 1,