Commit d937e24
committed
Fix isLoading stuck true with coalesced requests in reactive frameworks
When multiple reactive getters (e.g., in Alpine.js) call .it() for the same
item during a single reactive cycle, the requests are correctly coalesced but
isLoading can remain true even after data is fetched.
Root cause: finalizeItemMeta only set isLoading=false when query IDs matched
or activeQueryId was null. With coalesced requests, especially silent fetches,
the activeQueryId matching logic could fail.
Solution: Explicitly check if ref.data exists. If data is present, the item
is definitively not loading, regardless of query ID matching. This handles
the coalescing edge case while preserving all existing behavior.
This fix ensures proper loading states for:
- Alpine.js reactive computed properties
- React hooks with multiple consumers
- Vue computed properties
- Svelte reactive declarations
Fixes: https://github.com/YidiDev/verity/issues (see BUG.md)
Version: 1.0.7 → 1.0.81 parent 1ed6a16 commit d937e24
2 files changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1053 | 1053 | | |
1054 | 1054 | | |
1055 | 1055 | | |
1056 | | - | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1057 | 1061 | | |
1058 | 1062 | | |
1059 | 1063 | | |
| |||
0 commit comments