Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Dec 1, 2025

Let's say we trigger two times a RPC that fails.

The first time, the cache is empty and we make the RPC. The ram cache is filled with prom.

The second time, we get prom from the ram cache.

When the RPC actually finishes, we end up in

.catch((error) => {
    this.ramCache.delete(table, key);
    def.reject(error);
});

=> the RPC failure is catched, which means prom itself is not rejected. Instead, it resolves with the result of .catch(...), which is undefined

Here is a simplified toy example:

const prom = Promise.resolve(
    Promise.reject(new Error("fetch failed")).catch(() => {})
);

In this example, prom is successful and the result is undefined

"

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #238185
Forward-Port-Of: #237984

Let's say we trigger two times a RPC that fails.

The first time, the cache is empty and we make the RPC. The ram cache is
filled with `prom`.

The second time, we get `prom` from the ram cache.

When the RPC actually finishes, we end up in `onRejected`

=> the RPC failure is catched, which means `prom` itself is not rejected.
Instead, it resolves with the result of `onRejected`, which is `undefined`

Here is a simplified toy example:

```
const prom = Promise.resolve(
    Promise.reject(new Error("fetch failed")).then(() => {}, () => {})
);
```
In this example, `prom` is successful and the result is `undefined`

X-original-commit: 257c34f
Co-authored-by: rrahir <rar@odoo.com>
@robodoo
Copy link
Contributor

robodoo commented Dec 1, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Dec 1, 2025

@LucasLefevre @aab-odoo cherrypicking of pull request #237984 failed.

stdout:

CONFLICT (modify/delete): addons/web/static/src/core/utils/persistent_cache.js deleted in eea63f31d30e95617a38b1acf0e3da9a382edc0b and modified in 540bbffb23965d5228c0706475f2c5db3784c125.  Version 540bbffb23965d5228c0706475f2c5db3784c125 of addons/web/static/src/core/utils/persistent_cache.js left in tree.
CONFLICT (modify/delete): addons/web/static/tests/core/utils/persistent_cache.test.js deleted in eea63f31d30e95617a38b1acf0e3da9a382edc0b and modified in 540bbffb23965d5228c0706475f2c5db3784c125.  Version 540bbffb23965d5228c0706475f2c5db3784c125 of addons/web/static/tests/core/utils/persistent_cache.test.js left in tree.

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Dec 1, 2025
@LucasLefevre
Copy link
Contributor

It's already working in 19.0 and covered by a test

@LucasLefevre LucasLefevre deleted the 19.0-saas-18.3-rejected-persistent-cache-lul-481331-fw branch December 2, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants