fix: Clean up DDP publication close listeners - #42032
Conversation
|
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 |
|
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🧰 Additional context used📓 Path-based instructions (2)Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests Avoid code comments in the implementation📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc) Files:
Use descriptive test names that clearly communicate expected behavior in Playwright tests Use `.spec.ts` extension for test files (e.g., `login.spec.ts`)📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc) Files:
🔇 Additional comments (2)
Walkthrough
ChangesPublication lifecycle cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change removes stale client close listeners when publications stop while preserving existing client-close behavior. No actionable merge-blocking risk remains beyond normal checks and review. Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The implementation removes each publication's client close listener during stop cleanup. The tests cover explicit stop, repeated subscription churn, and client closure. These changes satisfy issue
Warning Errors were encountered while retrieving linked issues. Errors (1)
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 |
Proposed changes (including videos or screenshots)
Remove a DDP publication's client
closelistener when the publication stops. Previously, stopped publications were removed fromclient.subscriptions, but their one-time listeners remained attached until the WebSocket closed.This adds regression coverage for:
Issue(s)
Closes #42031
Steps to test or reproduce
yarn workspace @rocket.chat/ddp-streamer test Publication.spec.tsWithout the fix, the explicit stop and subscription churn tests retain client
closelisteners. With the fix, the listener count returns to zero while the existing client-close behavior remains intact.Further comments
The runtime regression scenario was also verified with the repository's required Node.js 22.22.3. Full Jest and lint execution was not available in the local sparse checkout because Yarn validates workspace manifests outside the checked-out paths; the test is included for CI execution.
Summary by CodeRabbit
Bug Fixes
Tests