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 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 angular/fw-service-worker as a code owner Nov 20, 2019
@googlebot googlebot added the cla: yes label Nov 20, 2019
@ngbot ngbot bot added this to the needsTriage milestone Nov 20, 2019
Copy link
Member

gkalpak left a comment

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

packages/service-worker/worker/src/data.ts Outdated Show resolved Hide resolved
@apocalyp0sys apocalyp0sys force-pushed the apocalyp0sys:sw-mutating-requests-lru-cache-write-fix branch 2 times, most recently from a8820d8 to 528477b Nov 21, 2019
@ngbot

This comment has been minimized.

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

This comment was marked as outdated.

Copy link
Member

gkalpak commented Nov 21, 2019

merge-assistance: The integration_test failure is unrelated. (Will be fixed by #33955.)

@matsko

This comment has been minimized.

Copy link
Member

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 #33793
@apocalyp0sys apocalyp0sys force-pushed the apocalyp0sys:sw-mutating-requests-lru-cache-write-fix branch from 528477b to 809e9da Nov 22, 2019
@apocalyp0sys

This comment has been minimized.

Copy link
Contributor Author

apocalyp0sys commented Nov 22, 2019

@matsko rebased onto master

matsko added 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 added 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 added 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.