Skip to content
Snippets Groups Projects
Commit 637684fb authored by Sébastien Theys's avatar Sébastien Theys
Browse files

[FIX] web: ignore recursiveCallMounted on not yet rendered children


This should hopefully fix the race condition that is described in the related
task. The issue is that our mounted callbacks are legitimately relying on the
component to be actually rendered.

task-2481713

closes odoo/odoo#68838

X-original-commit: 8782de99
Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
parent e208da93
No related branches found
No related tags found
No related merge requests found
......@@ -375,6 +375,17 @@ odoo.define('web.OwlCompatibility', function () {
*/
on_attach_callback() {
function recursiveCallMounted(component) {
if (
component.__owl__.status !== 2 /* RENDERED */ &&
component.__owl__.status !== 3 /* MOUNTED */ &&
component.__owl__.status !== 4 /* UNMOUNTED */
) {
// Avoid calling mounted on a component that is not even
// rendered. Doing otherwise will lead to a crash if a
// specific mounted callback is legitimately relying on the
// component being mounted.
return;
}
for (const key in component.__owl__.children) {
recursiveCallMounted(component.__owl__.children[key]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment