RESOLVED FIXED 229554
WKWebView: navigator.serviceWorker.register method fails for a new version of an already registered service worker.
https://bugs.webkit.org/show_bug.cgi?id=229554
Summary WKWebView: navigator.serviceWorker.register method fails for a new version of...
Kiran Satheesan
Reported 2021-08-26 07:01:48 PDT
Created attachment 436506 [details] navigator.serviceWorker.register error on console WKWebView: navigator.serviceWorker.register method fails for a new version of an already registered service worker. Overview The issue here is that it is not possible to use register method to load a new version of service worker once 3 registrations are reached. In this case the register operation does not violate the limit as its an update operation. Steps to Reproduce 1. On WKWebView try to load 2 websites with service workers 2. From a new website execute -> navigator.serviceWorker.register('sw.js?version=1') 3. Now the max limit of 3 is reached. 4. After this try to update the service worker by executing -> navigator.serviceWorker.register('sw.js?version=2') Actual Result - register method fails with the error - "TypeError: Job rejected for non app-bound domain". This happens even though the limit of 3 will not be exceeded. Expected Result - register method should not fail if the limit of 3 is not exceeded. Environment Device: iPad Mini 4 OS: iOS 15.0 (19A5325f)
Attachments
navigator.serviceWorker.register error on console (90.06 KB, image/png)
2021-08-26 07:01 PDT, Kiran Satheesan
no flags
Patch (38.48 KB, patch)
2022-04-12 14:28 PDT, Kate Cheney
no flags
Sam Sneddon [:gsnedders]
Comment 1 2021-08-26 07:16:46 PDT
> - register method fails with the error - "TypeError: Job rejected for non app-bound domain". We should also fail with a more accurate error message, given this is only one of several reasons validation can fail.
Radar WebKit Bug Importer
Comment 2 2021-08-26 07:16:58 PDT
youenn fablet
Comment 3 2021-09-09 00:08:41 PDT
@Kiran, can you try on the latest iOS beta?
Kiran Satheesan
Comment 4 2021-09-09 09:46:50 PDT
I was able to reproduce this behavior on iOS 15.0 Beta 8.
Kate Cheney
Comment 5 2022-04-12 14:28:47 PDT
Brent Fulgham
Comment 6 2022-04-12 15:26:16 PDT
Comment on attachment 457477 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457477&action=review r=me > Tools/TestWebKitAPI/Info.plist:-23 > - <string>http://foo.com/</string> Was "http://foo.com" never used? I never noticed!
Kate Cheney
Comment 7 2022-04-12 15:53:53 PDT
(In reply to Brent Fulgham from comment #6) > Comment on attachment 457477 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=457477&action=review > > r=me Thanks! I'll wait for EWS before landing. > > > Tools/TestWebKitAPI/Info.plist:-23 > > - <string>http://foo.com/</string> > > Was "http://foo.com" never used? I never noticed! I added a bunch of random domains to test that we stop after the max limit of 10 domains, so it was used for that. But it won't cause test failures or issues to replace it with a domain that is actually useful!
Kate Cheney
Comment 8 2022-04-14 07:24:24 PDT
Comment on attachment 457477 [details] Patch Failing test: TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing seems unrelated and has been flaky failing on EWS (see https://ews-build.webkit.org/#/builders/9/builds/69214)
EWS
Comment 9 2022-04-14 07:54:10 PDT
Committed r292867 (249638@main): <https://commits.webkit.org/249638@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 457477 [details].
Thomas
Comment 10 2023-03-20 17:08:11 PDT
is there anyway to get past the the 3 app bound domains limitation? I also have an app which installs serviceworker dynamically and upon reaching 3 can no longer install. is there any way to remove from those 3 to replace with new serviceworker registration?
Note You need to log in before you can comment on or make changes to this bug.