Skip to content

Commit

Permalink
[REL] v2.5.2
Browse files Browse the repository at this point in the history
# v2.5.2

 - [FIX] runtime: make error recovery more robust
  • Loading branch information
ged-odoo committed Dec 2, 2024
1 parent 1c5b6f2 commit aeed79c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
24 changes: 20 additions & 4 deletions docs/owl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,13 @@ function makeRootFiber(node) {
fibersInError.delete(current);
fibersInError.delete(root);
current.appliedToDom = false;
if (current instanceof RootFiber) {
// it is possible that this fiber is a fiber that crashed while being
// mounted, so the mounted list is possibly corrupted. We restore it to
// its normal initial state (which is empty list or a list with a mount
// fiber.
current.mounted = current instanceof MountFiber ? [current] : [];
}
}
return current;
}
Expand Down Expand Up @@ -1741,6 +1748,7 @@ class RootFiber extends Fiber {
const node = this.node;
this.locked = true;
let current = undefined;
let mountedFibers = this.mounted;
try {
// Step 1: calling all willPatch lifecycle hooks
for (current of this.willPatch) {
Expand All @@ -1760,7 +1768,6 @@ class RootFiber extends Fiber {
node._patch();
this.locked = false;
// Step 4: calling all mounted lifecycle hooks
let mountedFibers = this.mounted;
while ((current = mountedFibers.pop())) {
current = current;
if (current.appliedToDom) {
Expand All @@ -1781,6 +1788,15 @@ class RootFiber extends Fiber {
}
}
catch (e) {
// if mountedFibers is not empty, this means that a crash occured while
// calling the mounted hooks of some component. So, there may still be
// some component that have been mounted, but for which the mounted hooks
// have not been called. Here, we remove the willUnmount hooks for these
// specific component to prevent a worse situation (willUnmount being
// called even though mounted has not been called)
for (let fiber of mountedFibers) {
fiber.node.willUnmount = [];
}
this.locked = false;
node.app.handleError({ fiber: current || this, error: e });
}
Expand Down Expand Up @@ -5604,7 +5620,7 @@ function compile(template, options = {
}

// do not modify manually. This file is generated by the release script.
const version = "2.5.1";
const version = "2.5.2";

// -----------------------------------------------------------------------------
// Scheduler
Expand Down Expand Up @@ -6082,6 +6098,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat
export { App, Component, EventBus, OwlError, __info__, batched, blockDom, loadFile, markRaw, markup, mount, onError, onMounted, onPatched, onRendered, onWillDestroy, onWillPatch, onWillRender, onWillStart, onWillUnmount, onWillUpdateProps, reactive, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, validate, validateType, whenReady, xml };


__info__.date = '2024-11-26T08:42:41.633Z';
__info__.hash = '7fc552e';
__info__.date = '2024-12-02T15:51:07.157Z';
__info__.hash = '1c5b6f2';
__info__.url = 'https://github.com/odoo/owl';
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@odoo/owl",
"version": "2.5.1",
"version": "2.5.2",
"description": "Odoo Web Library (OWL)",
"main": "dist/owl.cjs.js",
"module": "dist/owl.es.js",
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// do not modify manually. This file is generated by the release script.
export const version = "2.5.1";
export const version = "2.5.2";

0 comments on commit aeed79c

Please sign in to comment.