odoo/odoo#237984
Created by BI, Lucas Lefèvre (lul)
Merged
at aa53689d3c593a8a41479c51edc2b01e3c284f96
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:saas-18.3-rejected-persistent-cache-lul
- head
- 05d2a5bb3b7b0a2e3aad060f9958c37624d8739b
- merged
- 1 day ago by JavaScript, Aaron Bohy (aab)
| odoo/odoo | |
|---|---|
| saas-18.3 | #237984 |
| saas-18.4 | #238185 |
| 19.0 | #238232 |
[FIX] web: cache rejected promises
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