-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: Omnichannel making a request for room data after every message sent #35618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Omnichannel making a request for room data after every message sent #35618
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 9f12749 The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 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 |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #35618 +/- ##
========================================
Coverage 59.64% 59.64%
========================================
Files 2832 2832
Lines 68313 68313
Branches 15129 15129
========================================
Hits 40747 40747
Misses 24960 24960
Partials 2606 2606
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
a04bc95 to
9192e27
Compare
9192e27 to
6d571d4
Compare
KevLehman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one missing place:
| return RoutingManager.unassignAgent(inquiry, departmentId, true); |
Here, the chat is "transfered" but since there's no online agents, it ends up in the department's queue. We should do the same we do on the manual move to queue func.
de6359b to
ec4748f
Compare
KevLehman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a small change in behavior, where the last message of the inquiry after being sent to department's queue ends up being the system message instead of the actual "last message"
Think we can live with that, and fix in a separate PR (as the fix would involve some extra work on other files)
|
This PR currently has a merge conflict. Please resolve this and then re-add the |
ec4748f to
9f12749
Compare
Proposed changes (including videos or screenshots)
This endpoint is called every time a message is sent by an omnichannel agent. On every message we used update the inquiry's
lastMessage, which caused an invalidation on the frontend so it mistakenly thought it would need to fetch the room data again (since something changed).The proposal is that we update the inquiry's last message only if it has not been taken yet. Once it is taken we update only the room's last message property. If it happens to the room to be sent back to the queue, then we update the inquiry's last message so it can reflect the latest state. A test was added to cover this exact behavior.
This is chart of a production workspace that uses inquiries, showing how massive the amount of calls to the endpoint is:

Issue(s)
CTZ-28
Steps to test or reproduce
Further comments