-
Notifications
You must be signed in to change notification settings - Fork 312
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
Should update() called on an installing worker reject (as currently does?) #1155
Comments
I believe we do. We added it to prevent the service worker spinning on a SW that calls update() before install completes and then has its install fail. If we queue an update job in those circumstances we will continuously run jobs that each fail. So we added this step to prevent self-update on uninstalled SW. |
Right. I remember the discussion. I'll keep it while addressing the issue raised through #1152: ensuring update() returns a promise regardless of the error conditions. Do we have a wpt test for this already by the way? |
Fixed the control flow of update() method that rejected a non-returned promise and aborted right away: 6281143. |
There is this test, but it seems to suggest it shouldn't throw: It seems we pass the test, so perhaps we don't implement the exception yet. |
Added a check to the test to ensure it throws: web-platform-tests/wpt#6107. Running the test with this change locally, chrome passes it already. |
Let me a question, please. What happens if I call |
They are basically scheduled to the job queue. If the job queue is empty when the first update is scheduled, that job is run right away. So, the second update will be queued and run later again. If more (same) update jobs are scheduled, they are not queued but aggregated (Schedule Job step 2.2) as a duplicate to the update job already pushed in the queue. EDIT: I was wrong. Please see the following comment. |
@delapuente, the first job queued and run will be popped from the queue when the job finishes. So, the second job should have been aggregated no matter whether the job queue was empty or not when the first job arrived. That is, the consecutive update() calls will always be aggregated. So, only one update occurs. (Note that, if other type of jobs (register or unregister) are queued in between, the latter update job is queued.) |
Closing this one as it's been settled and in the spec, though see related #1429. |
registration.update()
step 5 has:@mattto, @wanderview, AFAICT, Chrome doesn't have this error checking. Does Firefox check this? Do we need this error checking here?
The text was updated successfully, but these errors were encountered: