test(query-core/queryCache): add test for 'remove' only deleting the instance currently stored under its 'queryHash'#10888
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR adds a test case to the QueryCache test suite verifying that removing a stale query instance does not evict the current query from the cache when both instances share the same queryHash. ChangesQueryCache remove behavior
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit e244afe
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
…instance currently stored under its 'queryHash'
63c586f to
e244afe
Compare
🎯 Changes
Adds a test for
QueryCache.removecovering thequeryInMap === queryguard.When a stale
Queryreference is removed after a new instance has taken its place under the samequeryHash,removemust only delete the instance currently stored in the cache — not the newer one. The test builds a query, removes it to leave a stale reference, builds a fresh instance with the same key, then removes via the stale reference and assertsqueryCache.get(hashKey(key))still returns the current instance.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
This release contains internal improvements with no user-facing changes.