-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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] Missing User when forwarding Omnichannel conversations via Apps-Engine #17918
[FIX] Missing User when forwarding Omnichannel conversations via Apps-Engine #17918
Conversation
app/apps/server/bridges/livechat.js
Outdated
return Livechat.transfer( | ||
this.orch.getConverters().get('rooms').convertAppRoom(currentRoom), | ||
this.orch.getConverters().get('visitors').convertAppVisitor(visitor), | ||
{ userId: targetAgent.id, departmentId }, | ||
{ userId: targetAgent ? targetAgent.id : undefined, departmentId, transferredBy}, |
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.
{ userId: targetAgent ? targetAgent.id : undefined, departmentId, transferredBy}, | |
{ userId: targetAgent ? targetAgent.id : undefined, departmentId, transferredBy }, |
- add transferredBy property to transferData object in transferVisitor()
@@ -134,10 +134,18 @@ export class AppLivechatBridge { | |||
currentRoom, | |||
} = transferData; | |||
|
|||
const appUser = Users.findOneByAppId(appId); | |||
const transferredBy = { |
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.
const transferredBy = { | |
if (!appUser) { | |
throw new Error('Invalid user, cannot transfer'); | |
} | |
const { _id, username, name, type } = appUser; | |
const transferredBy = { | |
_id, | |
username, | |
name, | |
type, | |
} |
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.
Incorporated this change in the latest commit. REF 997469f
Thanks for the review 😄
Description
This PR attempts to close Issue #17911
Additionally, it adds a missing property
transferredBy
to thetransferData
object begin passed on totransfer
method 👇Rocket.Chat/app/livechat/server/lib/Livechat.js
Line 580 in 77aff86
This is property is required for the following
check
insaveTransferHistory
method.Rocket.Chat/app/livechat/server/lib/Livechat.js
Line 556 in 77aff86
I'm assigning the
app-User
to this missing property since this method will always be triggered by an app.Issue(s)
Closes #17911
Screenshots
Handover Action is being processed properly