Skip to content

Commit 9d80f0e

Browse files
committed
Fix silent fetch activeQueryId not being set (v1.0.14)
CRITICAL BUG FOUND: Silent fetches were not setting activeQueryId! The Issue: When _startItemFetch is called with loud=false (silent fetch), it was only setting activeLevelQueryIds but NOT activeQueryId (line 1603). This caused finalizeItemMeta to fail query ID matching, leaving isLoading=true. Timeline: 1. Silent fetch starts: activeLevelQueryIds set, but activeQueryId NOT set 2. Fetch completes: finalizeItemMeta called with qid 3. Query matching: prevActiveQueryId is null, matchedActiveQuery = false 4. Result: isLoading stays true because query IDs don't match The Fix: Always set activeQueryId when starting a fetch, regardless of loud/silent. Only the isLoading flag should differ between loud and silent fetches. Before (line 1603): assignRef(ref, { meta: { ...ref.meta, error: null, activeLevelQueryIds: nextActiveLevels } }) After: assignRef(ref, { meta: { ...ref.meta, error: null, activeQueryId: qid, activeLevelQueryIds: nextActiveLevels } }) This matches the collection fetch behavior which ALWAYS sets activeQueryId (line 1532), ensuring query ID matching works correctly in finalizeItemMeta. Version: 1.0.13 → 1.0.14
1 parent c7c0a51 commit 9d80f0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "verity-dl",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"description": "A framework agnostic data layer built to handle the communication layer between the server and the client seamlessly and keep the ui state always up to date with the source of truth",
55
"main": "verity/shared/static/lib/core.js",
66
"module": "verity/shared/static/lib/core.js",

verity/shared/static/lib/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,11 +1596,11 @@ async function _startItemFetch(typeName, id, levelName, { loud = false, force =
15961596

15971597
const qid = genQid();
15981598
const nextActiveLevels = setActiveLevelQueryId(ref.meta, canonicalLevel, qid);
1599-
// Spin if loud; otherwise keep current spinner state
1599+
// Always set activeQueryId for query matching, but only set isLoading if loud
16001600
if (loud) {
16011601
assignRef(ref, { meta: { ...ref.meta, isLoading: true, error: null, activeQueryId: qid, activeLevelQueryIds: nextActiveLevels } });
16021602
} else {
1603-
assignRef(ref, { meta: { ...ref.meta, error: null, activeLevelQueryIds: nextActiveLevels } });
1603+
assignRef(ref, { meta: { ...ref.meta, error: null, activeQueryId: qid, activeLevelQueryIds: nextActiveLevels } });
16041604
}
16051605

16061606
const fallbackFetcher = levelCfg ? levelCfg.fetch : T.fetch;

0 commit comments

Comments
 (0)