Commit 05e1298
authored
test(core): add getResponseMeta-paths integration test (non-GC angle) (#3929)
* test(core): replace getResponseMeta-countRef with getResponseMeta-paths
The previous integration test poked GCPolicy['entityCount'] directly to
prove the journey-mutation bug. Replace it with a test that asserts the
public-API consequence the bug creates outside of GC: every subscriber
to the same endpoint must observe the same expiresAt from
Controller.getResponseMeta().
This is the property the bug actually broke for non-GC users: with the
buggy paths.shift(), entityExpiresAt(paths, …) iterates a
progressively-shorter list, dropping the entity with the earliest
expiry first. Subscriber 2 observes a too-late expiresAt; subscriber 3+
observe Infinity and never refetch. Fires under ImmortalGCPolicy too,
since entityExpiresAt is unconditional whenever the endpoint has no
top-level meta.expiresAt — typical for state populated via
controller.set(Entity, …), SSR hydration, or useQuery.
Verified the assertion fails on the buggy paths.shift() (m3.expiresAt
returns FOO_2_EXPIRY instead of FOO_1_EXPIRY) and passes on the fix.
* test(core): keep existing countRef integration test alongside paths test
Restore the GC-side getResponseMeta-countRef.ts integration test that
the prior commit replaced. The two tests cover the journey-mutation
bug from complementary angles:
- getResponseMeta-countRef.ts: GC consumer of paths (entityCount
under-counting → premature reaping under default GCPolicy).
- getResponseMeta-paths.ts: non-GC consumer of paths
(entityExpiresAt → suppressed entity-expiry refetch; fires under
ImmortalGCPolicy too).
Both pass on the fix; both fail on the buggy paths.shift().1 parent 059b0e3 commit 05e1298
1 file changed
Lines changed: 88 additions & 0 deletions
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments