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(service-worker): throw a critical error when handleFetch fails #51885

Closed
wants to merge 1 commit into from

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Sep 24, 2023

On Safari, the cache might fail on methods like match with an Internal error. Critical errors allows to fallback to safeFetch() in the Driver.

fixes: #50378

NB: This caching will still be broken since apparantly there a bug on Safari. This fix will only allow the app to recover from the bug. It can be considered as a workaround.

@JeanMeche JeanMeche force-pushed the sw-fetch-fail branch 2 times, most recently from 2377a08 to a55431c Compare September 24, 2023 21:27
@JeanMeche JeanMeche marked this pull request as ready for review September 24, 2023 21:27
@pullapprove pullapprove bot requested a review from alxhub September 24, 2023 21:27
@JeanMeche JeanMeche added browser: safari area: service-worker Issues related to the @angular/service-worker package labels Sep 24, 2023
@ngbot ngbot bot added this to the Backlog milestone Sep 24, 2023
@JeanMeche JeanMeche added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Sep 24, 2023
On Safari, the cache might fail on methods like `match` with an `Internal error`. Critical errors allows to fallback to `safeFetch()` in the `Driver`.

fixes: angular#50378
@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 25, 2023
@dylhunn
Copy link
Contributor

dylhunn commented Sep 26, 2023

This PR was merged into the repository by commit dcaad16.

@dylhunn dylhunn closed this in dcaad16 Sep 26, 2023
dylhunn pushed a commit that referenced this pull request Sep 26, 2023
…51885)

On Safari, the cache might fail on methods like `match` with an `Internal error`. Critical errors allows to fallback to `safeFetch()` in the `Driver`.

fixes: #50378

PR Close #51885
@JeanMeche JeanMeche deleted the sw-fetch-fail branch September 26, 2023 16:29
janniemeyer added a commit to janniemeyer/angular that referenced this pull request Sep 27, 2023
…ngular#51885).

Apply the workaround approved for Angular 16 to Angular 15 as in angular@c3d901e

Original description:
On Safari, the cache might fail on methods like `match` with an `Internal error`. Critical errors allows to fallback to `safeFetch()` in the `Driver`.

fixes: angular#50378

PR Close angular#51885
JeanMeche added a commit to JeanMeche/angular that referenced this pull request Sep 29, 2023
angular#51885 patched a call site that threw an error but there were 2 others call that needed to be wrapped in the same way by a try/catch.

`initializeFully` is part of the calls in `responseWith(handleFetch)`.

Same angular#51885, throwing `SwCriticalError`allows the driver to fallback to `safeFetch` and ensure `responseWith` doesn't fail.

Fixes angular#50378
alxhub pushed a commit that referenced this pull request Oct 4, 2023
…51960)

#51885 patched a call site that threw an error but there were 2 others call that needed to be wrapped in the same way by a try/catch.

`initializeFully` is part of the calls in `responseWith(handleFetch)`.

Same #51885, throwing `SwCriticalError`allows the driver to fallback to `safeFetch` and ensure `responseWith` doesn't fail.

Fixes #50378

PR Close #51960
alxhub pushed a commit that referenced this pull request Oct 4, 2023
…51960)

#51885 patched a call site that threw an error but there were 2 others call that needed to be wrapped in the same way by a try/catch.

`initializeFully` is part of the calls in `responseWith(handleFetch)`.

Same #51885, throwing `SwCriticalError`allows the driver to fallback to `safeFetch` and ensure `responseWith` doesn't fail.

Fixes #50378

PR Close #51960
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 27, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…ngular#51885)

On Safari, the cache might fail on methods like `match` with an `Internal error`. Critical errors allows to fallback to `safeFetch()` in the `Driver`.

fixes: angular#50378

PR Close angular#51885
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: service-worker Issues related to the @angular/service-worker package browser: safari target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FetchEvent.respondWith error iOS/iPadOS 16.4+
4 participants