refactor: return created record from registerGuest#32620
refactor: return created record from registerGuest#32620sampaiodiego merged 14 commits intodevelopfrom
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #32620 +/- ##
===========================================
- Coverage 56.75% 56.65% -0.11%
===========================================
Files 2498 2494 -4
Lines 55390 55387 -3
Branches 11457 11457
===========================================
- Hits 31439 31378 -61
- Misses 21243 21308 +65
+ Partials 2708 2701 -7
Flags with carried forward coverage won't be shown. Click here to find out more. |
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
…avoid breaking changes
9dbd8e8 to
c869396
Compare
c869396 to
328b47b
Compare
Related to OPI-5, PR #72 from Apps.WhatsApp, and PR #771 from Rocket.Chat.Apps-engine.
On the Apps.WhatsApp project, the process of handling new messages and incoming message endpoints has been streamlined. Specifically, there is no need to call
getLivechatVisitorsaftercreateVisitorwhen a new message arrives. Inendpoints/WhatsAppMessage.post, thedefineVisitorfunction withinregisterVisitorhas been modified to usemodify.getCreator().getLivechatCreator().createVisitor()only. The call toread.getLivechatReader().getLivechatVisitors()has been removed sincecreateVisitornow returns the inserted or updated record.Also, changes were made here at Rocket.Chat project. The
createVisitormethod in the Livechat bridge has been updated. WithinLivechatTyped.registerGuest, a new method on modelLivechatVisitors, calledupdateOneByIdOrTokenwas added to handle both insert and update operations. This eliminates the need to run an insert followed by an update, optimizing the overall process.Performance comparison
K6 test results before changes
Incoming messages from WhatsApp flow with new visitor on every request.
Incoming messages from WhatsApp flow with same visitor on every request.
K6 test results after changes
Incoming messages from WhatsApp flow with new visitor on every request.
Incoming messages from WhatsApp flow with same visitor on every request.