From 5a1302ef7b1f32584515baf3cec50bc8b895bbcb Mon Sep 17 00:00:00 2001 From: Josh Deeden Date: Wed, 5 Aug 2026 11:23:38 -0700 Subject: [PATCH] Honor {fetch: false} in dataPool.getDaily (#1087) The Favorites tab passes {fetch: false} to getDaily, intending to read from the in-memory cache only, but the guard tested for === false and so ran the fetch in exactly the case it was asked not to. Because the call sits inside an awaited for loop over every stored favorite, that produced one serialised events.php request per favorite on each visit. Inverting the comparison makes a cache miss return undefined, which favorites.js already handles: the stored copy is left alone and the list renders from local storage. Note this also removes the incidental refresh those requests were doing. Responses are filtered through pick() either way, so no field is lost, but values saved alongside a favorite are no longer updated in the background. That matches the documented intent: pick() notes the data "might be stale", and CalVue.md still lists a refresh helper and a staleness disclaimer as open items. --- cal/src/support/dataPool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cal/src/support/dataPool.js b/cal/src/support/dataPool.js index 1540c819..9b6343e1 100644 --- a/cal/src/support/dataPool.js +++ b/cal/src/support/dataPool.js @@ -29,7 +29,7 @@ export default { const cached = caldaily_map.get(caldaily_id); if (cached) { return cached; - } else if (!options || options.fetch === false) { + } else if (!options || options.fetch !== false) { // grab one event: const url = buildUrl(API_EVENTS_URL, {id: caldaily_id}); const resp = await fetch(url); // fetch is built-in browser api