regression: restore reactive ConnectionStatusBar updates during reconnection#40616
Conversation
…atusBar Drive ServerProvider's status snapshot off Meteor.status's Tracker reactivity instead of `_stream` `reset`/`disconnect` events. The stream only fires when the socket itself reconnects or drops, so internal status transitions (`connecting` <-> `waiting`) and per-second `retryTime` ticks left ConnectionStatusBar pinned on a stale status during reconnection. `subscribeStatus` also recomputes the snapshot immediately after wiring the bridge so the value picked up by `useSyncExternalStore` doesn't remain stuck on whatever `cachedStatus` held at module load, closing the race when the socket connected before `<ServerProvider>` mounted. Regression from #40482.
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughMeteor connection status bridging is refactored from direct stream event listening to reactive ChangesConnection Status Bridging Race Fix
Possibly related PRs
Suggested labels
Suggested reviewers
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #40616 +/- ##
===========================================
+ Coverage 69.63% 69.67% +0.03%
===========================================
Files 3323 3323
Lines 122762 122752 -10
Branches 21898 21899 +1
===========================================
+ Hits 85481 85522 +41
+ Misses 33915 33881 -34
+ Partials 3366 3349 -17
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Summary
ServerProvidernow drives its status snapshot offMeteor.status's Tracker reactivity (viameteorBackedSdk.onMeteorStatusChange) instead ofMeteor.connection._streamreset/disconnectevents. Stream events only fire when the socket itself reconnects or drops, so internalconnecting↔waitingcycles and per-secondretryTimeticks were silently dropped —ConnectionStatusBarstayed pinned on a stale status (or never appeared) while a reconnection ran.subscribeStatusrecomputes the snapshot immediately after wiring the bridge so the valueuseSyncExternalStorereturns on first mount can't stay stuck on whatevercachedStatuswas at module load, closing the race when the socket connected before<ServerProvider>mounted.Regression from #40482.
Test plan
ConnectionStatusBarcycling throughconnecting→waiting→connectingwith the countdown ticking down each second instead of freezing.waiting, resume the server, and confirm the bar disappears as soon as Meteor's status flips back toconnected(no manual page refresh needed).SDK_TRANSPORT_ENABLED=trueto confirm the SDK-transport branch still behaves the same.https://rocketchat.atlassian.net/browse/CORE-2203
Summary by CodeRabbit