Pierre Paridans 7a5cabe889 [FIX] website_event_track: crash in SW's fetch listener on Safari 17.0+
Before this commit, when browsing the "Events" part of website on Safari
(both macOS and iOS/ipadOS), the page could be loaded only once and
returns a "FetchEvent.respondWith received an error: NotSupportedError:
The operation is not supported." error message on afterward, completely
blocking access to everything under the `/event` path.

This error is actually thrown from the ServiceWorker's `fetch` event's
listener, and more specifically, from the storage availablity check.

Since Safari 17.0, the Storage API - and in this case its `estimate()`
function -  has been enabled in WebKit's builds for Apple platforms (see
WebKit PR [1]). But even if this feature should be available in Web
Workers (cf. MDN [2] and the spec [3]), it returns a NotSupportedError
error when called from the ServiceWorker on Safari 17.0+ (but works fine
in the global scope).

This commit works around that issue by wrapping this call in a
try/catch, acting as if not supported when an error happens.

Steps to reproduce (on Safari iOS):
- Install website_event_track module
- Navigate to the `/event` page
- Reload the page
=> Browser level error page "FetchEvent.respondWith received an
error..."

Note: due to the browser's engine restriction on iOS/ipadOS, this issue
also affects all browsers on these platforms.

[1]: https://github.com/WebKit/WebKit/pull/10973
[2]: https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/estimate
[3]: https://storage.spec.whatwg.org/#ref-for-dom-storagemanager-estimate

opw-3553880
opw-3570730
opw-3610167
opw-3629039
opw-3547759

closes odoo/odoo#146190

X-original-commit: 45020635a81ce53ee0769ca54ac733528e4110b1
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-12-14 06:56:23 +00:00
2023-11-02 21:02:44 +00:00
2023-12-11 05:29:19 +00:00
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%