[Webkit-unassigned] [Bug 227531] New: Service worker methods register and update are not working as expected in WKWebView

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 30 08:34:41 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=227531

            Bug ID: 227531
           Summary: Service worker methods register and update are not
                    working as expected in WKWebView
           Product: WebKit
           Version: Other
          Hardware: iPhone / iPad
                OS: iOS 14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Service Workers
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: 18kirans at gmail.com

Created attachment 432597

  --> https://bugs.webkit.org/attachment.cgi?id=432597&action=review

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.

    Also once the limit of 3 is reached it was not possible to update any of the registered service workers as well.

    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.

-- 
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/20210630/078deee9/attachment.htm>


More information about the webkit-unassigned mailing list