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
chore: prevent multiple room finds during requestRoom method #32363
base: develop
Are you sure you want to change the base?
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 |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #32363 +/- ##
========================================
Coverage 55.55% 55.55%
========================================
Files 2406 2402 -4
Lines 52882 52833 -49
Branches 10861 10855 -6
========================================
- Hits 29376 29350 -26
+ Misses 20900 20882 -18
+ Partials 2606 2601 -5
Flags with carried forward coverage won't be shown. Click here to find out more. |
c3e7598
to
eac2d8b
Compare
Proposed changes (including videos or screenshots)
Changing the order in which things happen can help avoid testing the same things multiple times.
Previously, we would test if the system had an agent online, then find who was online, and then assign once again. These actions end up being repetitive, making the system difficult to understand and consuming CPU.
We also avoid calling the same collection multiple times to update different fields on the same document, thus optimizing messages sent to the database.
Database operations( find/update)
GET http://localhost:3000/api/v1/livechat/room?token=${visitor.token}
88 versus 76
With that, the order of events has changed a bit, but I believe it's not something problematic.
old:
new
Issue(s)
after:
Steps to test or reproduce
Further comments
https://rocketchat.atlassian.net/browse/CORE-440