[Webkit-unassigned] [Bug 227531] Service worker methods register and update are not working as expected in WKWebView
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jul 13 08:49:21 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=227531
--- Comment #3 from Kate Cheney <katherine_cheney at apple.com> ---
Hi, thanks for the report.
(In reply to Kiran S from comment #0)
> Created attachment 432597 [details]
> Screenshots for service worker registration and update error
>
> Overview
>
> Currently all app bound domains are not allowed to register a service
> worker.
>
> From the observations it seems like there seems to be a limit of 3
> service worker per WebView (Not per domain).
> So if there are 5 app bound domains which have service worker. Only the
> 3 domains loaded first would be able to register their service workers.
>
> The next registration attempt would fail with the following error.
> "TypeError: Job rejected for non app-bound domain"
> Even though the domain is app bound and doesn't have any previous
> service worker registrations.
>
This is expected, the max number of service workers for any WKWebView using app bound domains is 3.
> Also once the limit of 3 is reached it was not possible to update any of
> the registered service workers as well.
>
I would not expect this, and will look into it.
> Note: I saw the ticket where the limitation of 3 service workers was
> added - https://bugs.webkit.org/show_bug.cgi?id=213601.
> But it was not clear if this was intended for the whole webview since
> there could be multiple app bound domains and subdomains.
>
>
> Steps to Reproduce
>
> 1. Prepare 4 separate domains or subdomains with service worker support.
> These should be valid App Bound Domains.
> 2. Load each domain one after another and verify service worker
> registration.
> 3. After all the domains are loaded. Try to update any of the existing
> service worker registrations.
>
> Actual Result
>
> - The first 3 "navigator.serviceWorker.register" method invocations
> would successfully register service workers for respective domains.
> The fourth registration attempt fails with the error - "TypeError:
> Job rejected for non app-bound domain"
>
> - After the limit of 3 is reached. It was not possible to update any of
> the registered service workers as well.
> Attempting to do so would also throw the same error - "TypeError: Job
> rejected for non app-bound domain"
>
> Expected Result
>
> - navigator.serviceWorker.register would successfully register service
> worker for a valid app bound domain.
>
> - ServiceWorkerRegistration.update should update existing service
> worker registrations.
>
> Environment
>
> Device: iPad Mini 4
> OS: iOS 14.7 (18G5042c)
>
> Additional Info
>
> In our use case there are dynamic subdomains which would need service
> worker support.
> Currently we register the parent domain as app bound and we are getting
> service worker support for the targeted domains.
> But the issue we are facing currently is that the limit of 3 service
> workers seems to be across all app bound domains.
Thanks for sharing details about your use case. The limit of 3 service workers across all app-bound domains is intended behavior. I'll take a look at the issue you're experiencing trying to update registered workers, as I would not expect that behavior.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210713/1a3b562a/attachment.htm>
More information about the webkit-unassigned
mailing list