-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Skips "opaque" responses when handling life-cycle events #564
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5a54e08:
|
Hey, @timdeschryver. Thank you for writing this test. If you don't mind, I've polished it but a little. I would appreciate your review if you have a spare minute. Thanks! |
I've replaced the image example with a local test server with a strict CORS policy. This produces the same exception without the fix, making the test fail. The main reason for doing so is to remove any external dependency (such as on an external image provider) in our tests. It should be possible to run all test suites offline, which implies no dependencies on actual servers. We can substitute actual servers with the |
321019d
to
153bf03
Compare
153bf03
to
35b02e4
Compare
I believe that the Codesandbox build won't succeed with this breaking change to the Service Worker file. Without the addition of the
While this isn't nice, we are going to publish this in the next minor release, indicating a breaking change. That change will imply that you have to update your worker script by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contrary to what I have said on discord if there is a network error the service worker will not call the function sendToClient
. I suggest only adding an extra as in the comment above, then for me is super ok :)
Actually, I think you're right to introduce the safety check, @marcosvega91. I've tested this once more and it produces an infinite loop with an outdated worker. I don't think that's a good experience to aim for. I will add a safety check that will be removed in the minor release after the next one. We'll give it 1 version to bake in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for the cleanup!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 💪🏽
GitHub
Changes
mode: "no-cors"
) based on theirresponse.type
value.Response
type).