Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] website_event_track: crash in SWs fetch listener on Safari 17.0+ #1223

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

gbaumgartner-callino
Copy link

@gbaumgartner-callino gbaumgartner-callino commented Mar 11, 2024

This is a cherry pick of odoo@7a5cabe

Description of the issue/feature this PR addresses:
This PR addresses an issue opening events on Safari Browser 17.0+
Opening another event after having looked at another one leads to a Browser Crash

Current behavior before PR:
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).

Desired behavior after PR is merged:
Any event can be opened on Safari Browser without Crashing the page


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants