| Summary: | WKWebView: navigator.serviceWorker.register method fails for a new version of an already registered service worker. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Kiran Satheesan <kiran.satheesan> | ||||||
| Component: | Service Workers | Assignee: | Kate Cheney <katherine_cheney> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | bfulgham, cdumez, gsnedders, joji.jacob, katherine_cheney, simon.bluhm, tomyancey1, webkit-bug-importer, youennf | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | Other | ||||||||
| Hardware: | iPhone / iPad | ||||||||
| OS: | Other | ||||||||
| Attachments: |
|
||||||||
> - 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.
@Kiran, can you try on the latest iOS beta? I was able to reproduce this behavior on iOS 15.0 Beta 8. Created attachment 457477 [details]
Patch
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! (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! 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) 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]. 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? |
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)