fix: show disabled status when Presence_broadcast_disabled is enabled#40051
fix: show disabled status when Presence_broadcast_disabled is enabled#40051ricardogarim wants to merge 2 commits intodevelopfrom
Presence_broadcast_disabled is enabled#40051Conversation
|
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 |
🦋 Changeset detectedLatest commit: 5fc5e0d The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
**/*.spec.ts📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (23)📓 Common learnings📚 Learning: 2026-02-24T19:05:56.710ZApplied to files:
📚 Learning: 2026-03-16T21:50:37.589ZApplied to files:
📚 Learning: 2026-03-11T22:04:20.529ZApplied to files:
📚 Learning: 2026-03-16T22:56:54.500ZApplied to files:
📚 Learning: 2026-02-20T09:04:55.725ZApplied to files:
📚 Learning: 2026-01-27T20:57:56.529ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-03-15T14:31:23.493ZApplied to files:
📚 Learning: 2026-03-12T10:26:26.697ZApplied to files:
📚 Learning: 2026-02-10T16:32:42.586ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-12-10T21:00:54.909ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2026-03-06T18:09:17.867ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-12-16T17:29:45.163ZApplied to files:
📚 Learning: 2026-02-24T19:22:48.358ZApplied to files:
📚 Learning: 2026-03-06T18:10:15.268ZApplied to files:
🔇 Additional comments (4)
WalkthroughThis PR fixes a bug where the user status indicator fails to show a disabled state when presence broadcasting is turned off. The fix adds server-side checks to prevent status broadcasts and updates client-side fallback logic to display Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
🚥 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 #40051 +/- ##
===========================================
- Coverage 70.55% 70.53% -0.02%
===========================================
Files 3270 3272 +2
Lines 116769 116975 +206
Branches 21065 21090 +25
===========================================
+ Hits 82391 82514 +123
- Misses 32319 32401 +82
- Partials 2059 2060 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
When
Presence_broadcast_disabled=true(triggered automatically with 200+ connections without Premium license), users were seeing their last known status instead of grey/disabled dots.Root cause:
{ users: [] }when disabledapi.broadcast()calls that bypassed thePresence.broadcastEnabledcheckFix:
presence.ts): Use DISABLED as fallback status when presence is disabled, OFFLINE otherwiselisteners.module.ts): Block presence WebSocket events whenPresence_broadcast_disabledis trueIssue(s)
Steps to test or reproduce
Presence_broadcast_disabledtotruein MongoDB:falseand verify normal presence resumesFurther comments
Why the fix is in
listeners.module.tsinstead of at each broadcast source:Multiple places broadcast
presence.statusdirectly, bypassingPresence.broadcast():app/api/server/v1/users.tsapp/lib/server/functions/setStatusText.tsserver/services/calendar/statusEvents/applyStatusChange.tsThe listener is the central gatekeeper - any new code broadcasting presence events will automatically be blocked when disabled, without needing to remember to add checks everywhere.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests