Skip to content
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

Merged
merged 3 commits into from
Jun 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/apps/server/bridges/livechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,18 @@ export class AppLivechatBridge {
currentRoom,
} = transferData;

const appUser = Users.findOneByAppId(appId);
const transferredBy = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const transferredBy = {
if (!appUser) {
throw new Error('Invalid user, cannot transfer');
}
const { _id, username, name, type } = appUser;
const transferredBy = {
_id,
username,
name,
type,
}

Copy link
Contributor Author

@murtaza98 murtaza98 Jun 19, 2020

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 😄

_id: appUser._id,
username: appUser.username,
name: appUser.name,
type: appUser.type,
};

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 },
);
}

Expand Down