From 872227e07671db9280506becdf376028e7378619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Thu, 30 Sep 2021 08:37:29 +0000 Subject: [PATCH] [FIX] mail: prevent session expired with channel_info for guest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes odoo/odoo#77561 X-original-commit: e1c68fa4e3dbbdedce45a86f404ded2350c7b46c Signed-off-by: Alexandre Kühn (aku) Signed-off-by: Sébastien Theys (seb) --- .../messaging_notification_handler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js index 29d82e3ffcc..963278ebe9c 100644 --- a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js +++ b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js @@ -278,6 +278,9 @@ function factory(dependencies) { id: channelId, model: 'mail.channel', }); + if (!channel && this.messaging.isCurrentUserGuest) { + return; // guests should not receive messages for channels they don't know, and they can't make the channel_info RPC + } const wasChannelExisting = !!channel; const convertedData = this.messaging.models['mail.message'].convertData(messageData);