[Webkit-unassigned] [Bug 185483] New: iOS 11.3 delays creation of WKWebsiteDataStore and queues setCookie completion handler

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 9 12:02:34 PDT 2018


            Bug ID: 185483
           Summary: iOS 11.3 delays creation of WKWebsiteDataStore and
                    queues setCookie completion handler
           Product: WebKit
           Version: Other
          Hardware: iPhone / iPad
                OS: iOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: hshamansky at pinterest.com

We have the following flow in our app: If navigating to a particular URL in a WKWebView that requires a cookie, cancel the navigation, set a cookie, and in the cookie setter's completion block, load the original URL in the web view.

However, new behavior added by https://github.com/WebKit/webkit/commit/d9d6e5c82c4a74cd573f3f119f166ffcee477b04 delays the creation of the WKWebsiteDataStore such that the completion block is queued until "necessary", and WebKit never actually considers its creation "necessary" since we only load the URL in the completion block. It's essentially a deadlock.

Here's sample code:
if (@available(iOS 11.0, *)) {
        [webView.configuration.websiteDataStore.httpCookieStore setCookie:cookie
            [webView loadRequest:request];

This was caused by rdar://problem/33164453 (see also https://bugs.webkit.org/show_bug.cgi?id=176551)

Steps to Reproduce:
Cancel web view navigation, set a cookie with a completion handler that loads the original (canceled) URL. Take no other action on the web view.

Expected Results:
The cookie is set and the completion handler is called.

Actual Results:
The cookie is not set (and the completion handler is not called) until another action is taken on the WKWebView that requires the WKWebsiteDataStore to be initialized.

Issue affects iOS 11.3+ only. Rarely reproduces on simulator; frequently but not always reproduces on device.

iPhone X 11.3

Filed as rdar://40100673

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/20180509/a558211e/attachment-0001.html>

More information about the webkit-unassigned mailing list