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): allow creating post api requests after cache failure #33930

Conversation

apocalyp0sys
Copy link
Contributor

@apocalyp0sys apocalyp0sys commented Nov 20, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Before creating a mutating http request, service-worker invalidates lru cache entry and writes to cache storage. Therefore, cache storage failure can prevent making post requests.

Issue Number: #33793

What is the new behavior?

Cache storage error is catched and logged when trying to update lru cache table.

Does this PR introduce a breaking change?

  • Yes
  • No

@apocalyp0sys apocalyp0sys requested a review from a team as a code owner November 20, 2019 12:18
@gkalpak gkalpak added area: service-worker Issues related to the @angular/service-worker package action: review The PR is still awaiting reviews from at least one requested reviewer PR target: TBD type: bug/fix labels Nov 20, 2019
@ngbot ngbot bot added this to the needsTriage milestone Nov 20, 2019
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, @apocalyp0sys ❤️
(Nice commit message, btw 👍)

packages/service-worker/worker/src/data.ts Outdated Show resolved Hide resolved
@gkalpak gkalpak added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 21, 2019
@apocalyp0sys apocalyp0sys force-pushed the sw-mutating-requests-lru-cache-write-fix branch 2 times, most recently from a8820d8 to 528477b Compare November 21, 2019 11:10
@gkalpak gkalpak added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker and removed PR target: TBD action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Nov 21, 2019
@ngbot
Copy link

ngbot bot commented Nov 21, 2019

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "ci/circleci: integration_test" is failing
    pending missing required status "ci/circleci: publish_snapshot"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@gkalpak gkalpak added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Nov 21, 2019
@gkalpak

This comment has been minimized.

@matsko
Copy link
Contributor

matsko commented Nov 21, 2019

@apocalyp0sys please update the payload size amount so we can merge this.

Enable to create mocks for mutating http requests in tests
to check more scenarios.
…lure

Before creating a mutating http request, service-worker
invalidates lru cache entry and writes to cache storage.
Therefore, cache storage failure can prevent making post requests.
Fix this by catching and logging cache error, add a test case.

Fixes angular#33793
@apocalyp0sys apocalyp0sys force-pushed the sw-mutating-requests-lru-cache-write-fix branch from 528477b to 809e9da Compare November 22, 2019 06:44
@apocalyp0sys
Copy link
Contributor Author

@matsko rebased onto master

@gkalpak gkalpak removed the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Nov 22, 2019
matsko pushed a commit that referenced this pull request Nov 22, 2019
…33930)

Enable to create mocks for mutating http requests in tests
to check more scenarios.

PR Close #33930
matsko pushed a commit that referenced this pull request Nov 22, 2019
…lure (#33930)

Before creating a mutating http request, service-worker
invalidates lru cache entry and writes to cache storage.
Therefore, cache storage failure can prevent making post requests.
Fix this by catching and logging cache error, add a test case.

Fixes #33793

PR Close #33930
@matsko matsko closed this in 82be621 Nov 22, 2019
matsko pushed a commit that referenced this pull request Nov 22, 2019
…lure (#33930)

Before creating a mutating http request, service-worker
invalidates lru cache entry and writes to cache storage.
Therefore, cache storage failure can prevent making post requests.
Fix this by catching and logging cache error, add a test case.

Fixes #33793

PR Close #33930
@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 Dec 23, 2019
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 cla: yes target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants