-
Notifications
You must be signed in to change notification settings - Fork 29.7k
service worker removal #173609
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
service worker removal #173609
Conversation
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.
Code Review
This pull request removes the automatic service worker registration from Flutter web applications, replacing it with a cleanup worker designed to remove old caches from previous versions. The changes are well-contained within flutter_tools, flutter.js, and the relevant test files. The migration strategy appears sound. I have identified one critical issue in the new test implementation and one medium-severity issue regarding a duplicated test case in the web test suite.
|
/gemini review |
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.
Code Review
This pull request removes the automatic service worker registration from Flutter's web loader and replaces the default service worker with a cleanup worker that removes old caches and unregisters itself. The changes are well-implemented and the accompanying test verifies the cleanup behavior. I have a few suggestions to improve test realism and code clarity.
engine/src/flutter/lib/web_ui/flutter_js/src/service_worker_loader.js
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/web/file_generators/js/flutter_service_worker.js
Show resolved
Hide resolved
engine/src/flutter/lib/web_ui/flutter_js/src/service_worker_loader.js
Outdated
Show resolved
Hide resolved
fixed! |
|
Hi @SydneyBao, It looks like the tests are running into some issues. I suspect the large number of commits in this PR, possibly from an earlier merge conflict, might be causing unexpected problems. To help resolve this, could you please squash all your changes into a single commit? This will clean up the commit history and should help the tests run correctly. Here is a safe way to do this:
After that, please open a new pull request with this new branch, and check to see if the tests are running properly now. |
Hi @ ash2moon. Thank you! I have created a new pr here: #174991 |
|
@SydneyBao the failures were because of formatting and some tests needed to be removed. I fixed those, let's see if it works now. |
3f0952e to
4dc1ea9
Compare
|
Some of the commits that resulted from the merge conflict were causing weirdness with CLA signing. I squashed everything in one commit and that made the CLA check happy. |
|
This is being worked on here: #176834 |
Introduce a self-cleaning service worker to replace the old one. Previous attempts (#170918, #173609) had (accidentally?) disabled the loading of the service worker in `flutter.js`. This PR preserves the logic for loading the service worker, and it prints a deprecation warning. Towards #156910 Closes #106225
Introduce a self-cleaning service worker to replace the old one. Previous attempts (flutter#170918, flutter#173609) had (accidentally?) disabled the loading of the service worker in `flutter.js`. This PR preserves the logic for loading the service worker, and it prints a deprecation warning. Towards flutter#156910 Closes flutter#106225
Create a service worker that removes the old cached service worker.
Related issue: 156910
Pre-launch Checklist
///).