| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: eef56c9e-f49e-4db7-82ff-5d61602392ad 📥 CommitsReviewing files that changed from the base of the PR and between 46d7f02 and 9f71f4f. 📒 Files selected for processing (3)
📝 Walkthrough WalkthroughuseMutationState now removes mutations that no longer match its filters. A regression test covers pending mutations after completion, and a patch changeset documents the fix. ChangesMutation filter result updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Changes
Fixes #11152.
useMutationState() in @tanstack/svelte-query only ever grew its returned
array. The cache-subscription callback updated the underlying $state array
with Object.assign(result, nextResult), but Array.prototype.length is
non-enumerable, so Object.assign never truncates result when the new
result set is shorter. Once a mutation stopped matching filters (settled,
was removed/GC'd, or a narrower filter was applied), its stale entry stayed
in the array forever.
Fix: replace the Object.assign with result.splice(0, result.length, ...nextResult),
which replaces the array's contents in place — including truncating it —
while preserving the $state array's reference identity (required by the rune).
Includes a regression test that starts two mutations matching
filters: { status: 'pending' }, lets both settle, and asserts the returned
array goes back to [] instead of keeping the two stale "pending" entries.
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
Tests