From 71452c334f77452e05af4d12dcf6175f193a8b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Thu, 30 Sep 2021 12:13:41 +0000 Subject: [PATCH] [FIX] mail: remove annotateTraceback because it is extremely slow It could take seconds to annotate a simple stack trace, it is therefore not suited at all for quick logging as we do in RTC. It's unfortunate but acceptable to just log the non-annotated stack trace in that case. X-original-commit: 8b3495c489c274e878d2a0938ea29b4da17710aa Part-of: odoo/odoo#77656 --- addons/mail/static/src/models/rtc/rtc.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/mail/static/src/models/rtc/rtc.js b/addons/mail/static/src/models/rtc/rtc.js index b89f47899cd..01e4d6ff334 100644 --- a/addons/mail/static/src/models/rtc/rtc.js +++ b/addons/mail/static/src/models/rtc/rtc.js @@ -1,7 +1,6 @@ /** @odoo-module **/ import { browser } from "@web/core/browser/browser"; -import { annotateTraceback } from "@web/core/errors/error_utils"; import { registerNewModel } from '@mail/model/model_core'; import { attr, one2many, one2one } from '@mail/model/model_field'; @@ -374,14 +373,14 @@ function factory(dependencies) { * @param {String} [param2.step] current step of the flow * @param {String} [param2.state] current state of the connection */ - async _addLogEntry(token, entry, { step, state } = {}) { + _addLogEntry(token, entry, { step, state } = {}) { if (!this.env.isDebug()) { return; } if (!(token in this.logs)) { this.logs[token] = { step: '', state: '', logs: [] }; } - const trace = await annotateTraceback(window.Error()); + const trace = window.Error().stack || ''; this.logs[token].logs.push({ event: `${window.moment().format('h:mm:ss')}: ${entry}`, trace: trace.split('\n'),