Ensure watch history loads include full lists by default

This commit is contained in:
thePR0M3TH3AN committed 2025-10-08 08:11:26 -04:00
1 parent 10751a8fb9
commit 46ef2b8123
3 files changed
+10 -3

No files matched your search

+3 -1
View File
@@ -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" } };
},
+4 -1
View File
@@ -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) {
+3 -1
View File
@@ -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,