-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: Update Contact's custom fields when updating visitor custom fields #35580
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
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 9e70f13 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #35580 +/- ##
===========================================
+ Coverage 61.16% 61.19% +0.02%
===========================================
Files 2971 3119 +148
Lines 70838 73822 +2984
Branches 16184 16481 +297
===========================================
+ Hits 43325 45172 +1847
- Misses 24564 25620 +1056
- Partials 2949 3030 +81
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…ct and updates the customFields
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.
Can u add a changeset?
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Dismissed as Kevin is OOO.
|
/backport 7.5.2 |
|
Sorry, I couldn't do that backport because of conflicts. Could you please solve them? you can do so by running the following commands: after that just run |
|
/backport 7.5.2 |
|
Pull request #36170 added to Project: "Patch 7.5.2" |
Proposed changes (including videos or screenshots)
This PR aims to increment the logic of
.setCustomFields(), updating thecustomFieldsfrom the visitor'sContactentity when applicable.When
Contact.customFieldsis nullish and/oroverwriteistrue, it inserts the customFields accordingly. IfContact.customFieldsis not nullish and overwrite isfalse, it will save it as a conflict.Issue(s)
CTZ-17
Steps to test or reproduce
Further comments
This pull request introduces enhancements and bug fixes related to the handling of custom fields in the Rocket.Chat Livechat module. The key changes include:
Functionality Update: The
setCustomFieldsfunction is updated to correctly update the Context'scustomFieldsproperty, ensuring that custom fields are managed accurately.Livechat Bridge Enhancement: Implementation for setting custom fields is added to the
AppLivechatBridgeclass, with a note for future refactoring.Visitor Registration Enhancement: The visitor registration endpoint (
POST livechat/visitor) is enhanced to update custom fields for associated Livechat contacts when a visitor's custom fields are updated. This is achieved by introducing theLivechatContactsmodel and using theupdateContactsCustomFieldsfunction to perform updates in parallel.Custom Fields Refactoring: The
setCustomFieldsfunction is refactored to handle updates for associated livechat contacts when the scope is not 'room'. A new helper function,updateContactsCustomFields, is introduced to manage update logic, including handling overwrites and conflicts. This involves fetching the visitor, identifying associated contacts, and updating them concurrently.Error Handling Removal: Error handling for custom field operations is removed, which may potentially hide failures during these operations.
These changes aim to improve the robustness and functionality of custom field management within the Livechat module.