From 30f6ff4f93dd596b9115099e64ca386a76bc77de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Geelen=20=28sge=29?= Date: Tue, 24 Oct 2023 12:21:22 +0200 Subject: [PATCH] [FIX] web_editor: collaboration error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to improve the user Experience and not uselessly block access to the document, we prevent collaboration error to open the traceback dialog. task-3568680 closes odoo/odoo#139964 X-original-commit: df39cbc4dbc1922e91c53278db7fdcb12f01306e Signed-off-by: David Monjoie (dmo) Signed-off-by: Geelen Sébastien (sge) --- .../static/src/js/wysiwyg/PeerToPeer.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/PeerToPeer.js b/addons/web_editor/static/src/js/wysiwyg/PeerToPeer.js index 72d7bd4fe5f..905afb4b449 100644 --- a/addons/web_editor/static/src/js/wysiwyg/PeerToPeer.js +++ b/addons/web_editor/static/src/js/wysiwyg/PeerToPeer.js @@ -334,12 +334,18 @@ export class PeerToPeer { ); } } - const baseMethod = baseNotificationMethods[notification.notificationName]; - if (baseMethod) { - return baseMethod.call(this, notification); - } - if (this.options.onNotification) { - return this.options.onNotification(notification); + try { + const baseMethod = baseNotificationMethods[notification.notificationName]; + if (baseMethod) { + return baseMethod.call(this, notification); + } + if (this.options.onNotification) { + return this.options.onNotification(notification); + } + } catch (error) { + console.groupCollapsed('=== ERROR: On notification in collaboration ==='); + console.error(error); + console.groupEnd(); } } } @@ -578,8 +584,8 @@ export class PeerToPeer { ); } /** - * Attempts a connection recovery by updating the tracks, which will start a new transaction: - * negotiationneeded -> offer -> answer -> ... + * Attempts a connection recovery by updating the tracks, which will start + * a new transaction: negotiationneeded -> offer -> answer -> ... * * @private * @param {Object} [param1]