fix: Intermittent subscription update loss and socket lifecycle reliability - #51
Merged
Conversation
WalkthroughThis PR moves ChangesConnection lifecycle and teardown handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Ember/Client/index.ts`:
- Around line 709-728: The child insertion path in _updateTree() is pushing the
same parent-path change multiple times when update.children adds several missing
children. Update the TreeNode merge logic so the parent getPath(tree)
notification is queued only once per qualified update, while still attaching
each new child’s parent and inserting it into tree.children; use _updateTree(),
tree.children, and changes.push() to locate the fan-out branch.
In `@src/Ember/Socket/S101Socket.ts`:
- Around line 83-93: Finalize the socket teardown in S101Socket’s close handler
before notifying listeners: in the `this.socket.on('close', ...)` callback, move
the `status` update and keepalive timer cleanup ahead of
`this.emit('disconnected')` so any `disconnected` listeners observe
`ConnectionStatus.Disconnected` and no active timers. Keep the fix localized to
the close callback in `S101Socket`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 53cf2ee9-ccb8-4e06-b94c-9005dcb63729
📒 Files selected for processing (7)
src/Ember/Client/ConnectionStatus.tssrc/Ember/Client/__tests__/index.spec.tssrc/Ember/Client/index.tssrc/Ember/Socket/S101Client.tssrc/Ember/Socket/S101Socket.tssrc/Ember/Socket/__tests__/S101Socket.spec.tssrc/__mocks__/S101Client.ts
nytamin
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About the Contributor
This pull request is posted on behalf of the BBC.
Type of Contribution
This is a:
Bug fix / Code improvement
Current Behavior
New Behavior
Testing Instructions
Other Information
Status