-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Regression: Visitor being overwritten on call end #26756
Conversation
const { contact } = await getContactBy({ phone }); | ||
|
||
if (contact) { | ||
return contact as unknown as ILivechatVisitor; |
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.
The type returned by useEndpoint
is not compatible with the same type on core-typings
. If any of you know how to solve this, please let me know.
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.
Yes, this is because of Types Serialization, when we send some data over HTTP requests, the objects and types are converted to strings, in this case Date
type is converted to string
type which creates this problem.
Codecov Report
@@ Coverage Diff @@
## develop #26756 +/- ##
===========================================
+ Coverage 40.58% 40.61% +0.03%
===========================================
Files 799 799
Lines 18309 18309
Branches 1957 1957
===========================================
+ Hits 7431 7437 +6
+ Misses 10579 10575 -4
+ Partials 299 297 -2
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Approving since it works and we need it on QA 😬
Pls FE folks, do your magic here.
const { contact } = await getContactBy({ phone }); | ||
|
||
if (contact) { | ||
return contact as unknown as ILivechatVisitor; |
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.
This is something that is not exclusive to this PR, I seen this happen in other places, we need to investigate if this is an inconsistency issue between our types.
This is a work that will go over the scope of this PR so we can do this separately
…Chat/Rocket.Chat into regression/visitor-name-overwrite
0c0b252
Proposed changes (including videos or screenshots)
This PR adds a check to the
createRoom
method, responsible for creating VoIP rooms. It checks whether the visitor already exists before creating a new one, if one is found it uses it instead of overwriting existing visitors.Issue(s)
Steps to test or reproduce
Further comments