summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread_cache
diff options
context:
space:
mode:
authorPaul Morelle <pmo@odoo.com>2020-11-19 14:15:13 +0000
committerPaul Morelle <pmo@odoo.com>2020-11-20 10:28:32 +0000
commit14b1bbb248b39e0ddef4f3eb1f0f130f650ebdd4 (patch)
tree50b25496ab3d7e7d16e4d3111697e40016954174 /addons/mail/static/src/models/thread_cache
parent352e868f320344b06c4d44fd2df452080446dbb6 (diff)
[FIX] mail: avoid a stack overflow during loading
When the amount of mail messages is big enough (about 1500?), the recursion goes deeper and deeper, until the Javascript limit raises an infinite recursion error. This commit fixes the issue by avoiding to run an inner _flushUpdateCycle with the update if the change is not needed, so the second time that it is reached it does not start a new update, which would have run another flush update cycle. closes odoo/odoo#62076 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread_cache')
-rw-r--r--addons/mail/static/src/models/thread_cache/thread_cache.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/mail/static/src/models/thread_cache/thread_cache.js b/addons/mail/static/src/models/thread_cache/thread_cache.js
index 5ca4443df5f..8383936a3f1 100644
--- a/addons/mail/static/src/models/thread_cache/thread_cache.js
+++ b/addons/mail/static/src/models/thread_cache/thread_cache.js
@@ -195,7 +195,9 @@ function factory(dependencies) {
}
const wasCacheRefreshRequested = this.isCacheRefreshRequested;
// mark hint as processed
- this.update({ isCacheRefreshRequested: false });
+ if (this.isCacheRefreshRequested) {
+ this.update({ isCacheRefreshRequested: false });
+ }
if (this.thread.isTemporary) {
// temporary threads don't exist on the server
return false;