fix: missing "user left" system message after omnichannel room forward - #41480
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 56dcabe The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (7)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (4)📚 Learning: 2026-03-16T21:50:37.589ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-05-06T12:21:44.083ZApplied to files:
🔇 Additional comments (2)
WalkthroughChangesOmnichannel forwarding
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsErrors 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #41480 +/- ##
===========================================
- Coverage 68.62% 68.59% -0.03%
===========================================
Files 4134 4134
Lines 160801 160802 +1
Branches 29247 29267 +20
===========================================
- Hits 110342 110299 -43
- Misses 45353 45398 +45
+ Partials 5106 5105 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/jira CORE |
Proposed changes (including videos or screenshots)
When an omnichannel room is forwarded (agent, department, or department fallback),
RoutingManager.removeAllRoomSubscriptionsremoved each agent subscription with a fire-and-forgetvoid removeAgentFromSubscription(...)inside aforEach. Theul(user left) system message written inside that call was never awaited by any caller, so it raced the rest of the transfer flow: the message could be persisted only after the transfer had already completed and the endpoint had responded. Anything reading the room history right after the transfer — like theLIVECHAT - rooms livechat/room.forward system messages sent on transfer should be properly generatedAPI test — could intermittently see 0ulmessages, making that test flaky. It also allowed the message to land out of order relative to the transfer system messages.Changes:
removeAgentFromSubscriptioncall (iterating the cursor directly) so theulmessage is persisted before the transfer flow returns, and failures surface instead of being swallowed by the floating promiseufrom the subscriptions query, which is all the removal needsIssue(s)
Steps to test or reproduce
livechat/room.forward)ulsystem message is now always already presentFurther comments
The fire-and-forget dates back to the Fibers-era JS, where the call was effectively synchronous; the TS conversion added
voidto silence lint, making the race explicit but unhandled.Task: CORE-2449
Summary by CodeRabbit