[Webkit-unassigned] [Bug 180547] New: Message Handlers fail to call despite message being sent

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 7 13:38:04 PST 2017


            Bug ID: 180547
           Summary: Message Handlers fail to call despite message being
           Product: WebKit
           Version: Other
          Hardware: iPhone / iPad
                OS: iOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Page Loading
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: josh.hrach at gmail.com
                CC: beidson at apple.com

Created attachment 328731

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

Simple project demoing issue

Scenario: We have two AJAX calls that we are making within a web view. Each call has a callback that is called when the call is complete. As they are async calls, we wait for the callback to trigger a message before we reload the web view. 

When run in the iOS 11 simulator with Xcode 9, we get consistent behavior. AJAX Call 1 is sent, Call 1's callback is called and the message is handled. Call 2 is sent, same. This can be done ad infinitum with no issues.

On device, however, the behavior is different. After a certain number of calls (this varies between tests), eventually the callback fails to be handled by the device. Server logs show that the callback is indeed sent. The following is an example of what happens:
* Call 1 is sent
* Call 1's callback is called, app receives message
* Call 2 is sent
* Call 2's callback is called, app receives message
* Call 1 is sent
* No callback is detected
* Call 2 is sent
* Call 2's callback message is received
* Call 1's callback message is received

It seems that, after a certain number of messages, messages fail to come through promptly and appear stuck until another AJAX call/message is sent/received. This behavior was also seen when using WKHTTPCookieStore.getAllCookies(). A breakpoint set within the getAllCookies() closure was not hit until after several messages were received. I had expected this function to return me cookies right away, but instead something seemed to lock up the web view.

Enclosed is a sample project. Expected usage: Tap Set. Wait for Alert. Dismiss alert. Tap Clear. Wait for Alert. Dismiss alert. Repeat.
Simulator results: You should have no problem with the above sequence.
On device: After several attempts (my testing has shown it happening after as little as 2 calls or as many as 20), tapping one of the buttons will not trigger a callback message and alert. Console logs show that evaluateJavaScript's completion handler is called, but no message is received, despite server logs saying that they are sent. Eventually, tapping either button to continue testing will show multiple messages being retrieved at the same time.

Testing environment: Xcode 9.2
Device: iPhone X, iOS 11.2

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/20171207/c1de359d/attachment.html>

More information about the webkit-unassigned mailing list