fix(broadcast-client): don't overwrite an existing query's data on an incoming 'added' message - #11392
fix(broadcast-client): don't overwrite an existing query's data on an incoming 'added' message#11392lazerg wants to merge 2 commits into
Conversation
… incoming 'added' message
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe broadcast client now preserves existing query data when it receives an ChangesBroadcast added-state handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The broadcast client preserves resolved local query data when receiving an added message while allowing data-less queries to adopt incoming state. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…existing 'added' build coverage
🎯 Changes
Since 5.102.0, the
addedbroadcast message carries the query's state, and the receiving tab applies it withquery.setState(state)whenever the query already exists locally. A tab mounting a query for the first time always broadcastsadded, even if it hasn't fetched yet, so any other tab that already has resolved data for that key gets reset back topendingwith no data.This only skips
setStatewhen the local query already has data, so a query that has never resolved locally can still adopt state from anaddedmessage (matches how a brand-new tab picks up a key another tab already resolved viainitialData), while an already-resolved query in one tab won't get clobbered just because another tab mounts the same key.Fixes #11391
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
addedupdate for the same query.Tests