Open cuonghuunguyen opened 1 week ago
Hello! Actually, it was "broken" by another PR, where this change was introduced:
await Message.saveSystemMessageAndNotifyUser('livechat-close', newRoom._id, params.comment ?? '',
chatCloser, {
groupable: false,
transcriptRequested,
...(isRoomClosedByVisitorParams(params) && { token: params.visitor.token }),
}
);
Previously, we used the sendMessage
function to save these types of messages, but that was wrong. System messages should not produce any app events (cause they're system messages). When the code was updated to use saveSystemMessage
, this behavior (sending app events for system messages) was removed as a side effect.
So, you shouldn't expect any app notifications for system messages. To check if a livechat room is closed, pls use the IPostLivechatRoomClosed
event.
Tell us a bit more about your use case, and maybe we can improve Apps Engine so you can retrieve those system messages at will 👀
Description:
The livechat-close message doesn't trigger the message sent methods of Rocket.Chat Apps Engine.
Steps to reproduce:
Expected behavior:
The message trigger postMessageSent event and preMessageSent event
Actual behavior:
nothing was triggered
Server Setup Information:
Client Setup Information
Additional context
Caused by this PR https://github.com/RocketChat/Rocket.Chat/pull/32896
Relevant logs: