Skip to content
Snippets Groups Projects
Commit ff78ee49 authored by Arthur Detroux (ard)'s avatar Arthur Detroux (ard)
Browse files

[FIX] web: mitigate navigation error on iOS/iPadOS devices


Ever since iOS 16.4, going back and forth through a website with the
cache enabled, creates an error in the console which Odoo tries to
handle but fails to do so. Therefor a generic CORS error message
appears.

There is unfortunately no proper way to fix this bug on our end so
instead, this commit tries to mitigate the error by returning early and
not showing the traceback dialog.

I (ARD) have submitted a feedback through Apple's Feedback Assistant app
and will subsequently remove this commit when Apple releases an update
that fixes this.

opw-3281727

closes odoo/odoo#125463

X-original-commit: 2981378e
Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
parent 3860d576
Branches
Tags
No related merge requests found
......@@ -4,6 +4,8 @@ import { browser } from "../browser/browser";
import { _lt } from "../l10n/translation";
import { registry } from "../registry";
import { completeUncaughtError, getErrorTechnicalName } from "./error_utils";
import { isIOS } from "@web/core/browser/feature_detection";
import { session } from "@web/session";
/**
* Uncaught Errors have 4 properties:
......@@ -84,6 +86,13 @@ export const errorService = {
}
let uncaughtError;
if (!filename && !lineno && !colno) {
if (isIOS() && session.is_frontend && odoo.debug !== "assets") {
// In Safari 16.4+ (as of Jun 14th 2023), an error occurs
// when going back and forward through the browser when the
// cache is enabled. A feedback has been reported but in the
// meantime, hide any script error in these versions.
return;
}
uncaughtError = new UncaughtCorsError();
uncaughtError.traceback = env._t(
`Unknown CORS error\n\n` +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment