New issue
Advanced search Search tips

Issue 885218 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-10-08
OS: iOS
Pri: 1
Type: Bug



Sign in to add a comment

-[WKHTTPCookieStore getAllCookies:] completion handler is not always called

Project Member Reported by eugene...@chromium.org, Sep 18

Issue description

Chrome for iOS logged that getAllCookies: completion handler is not always called. Before launching WK-based cookie store we need to understand the implications of this bug. We can add UMA to Open In Controller... to count successful downloads. We can also try calling completion handlers on block's deallocation.
 
Labels: -ReleaseBlock-Stable
NextAction: 2018-09-25
The fix i sent yesterday https://chromium-review.googlesource.com/c/chromium/src/+/1225750
should address cases where the cookie store was deallocated and callback wasn't called because of that.
once that's in there we can get more accurate numbers regarding the callbacks loss rate.

I'll also be checking for the OpenIn controller to see if i can easily add UMA metric there - But i'm going to remove the RBS flag for now and wait for couple days to see the numbers after that fix was landed.
Labels: ReleaseBlock-Stable
Open In is the only feature which will use WK-based Cookie Store. And Open In does not log any metrics. Without metrics we won't know the direct impact of WK-based Cookie Store rollout.

The NextAction date has arrived: 2018-09-25
It seems that crbug/888545 addresses comment 2.

mrefaat - do you have an update here regarding comment 1?
If I'm not mistaken we still have cases when cookie retrieval callback is not called.
Regarding comment one, i updated the document here: https://docs.google.com/document/d/14bz7CFvLZ-83VN-FaidsprjUuq3Sl7U0p6N0pcL3NPE

"After the last fix was sent (just 1 week data) the loss of callbacks rates measured on the histogram is only 3%  gone down from 18% (it's highly likely that these 3 percent are cases where WKWebView was deallocated after getCookies is called)."
Labels: -ReleaseBlock-Stable -M-70 M-71
Can we log when getAllCookies: block is deallocated without being called? I don't think we need to block M70 because 3% loss does not look terrible.
NextAction: 2018-10-08
I'll look in to that.
The NextAction date has arrived: 2018-10-08
It seems that callback is not called if there is no active wkwebview.
What does "active" mean? Callback is not called if there are 0 instances of WKWebView for the given WKWebView configuration? Should we create a temporary web view as a workaround?
BY active here i meant on the view hierarchy. Creating a temporary web view is not enough here it has to be on added to the view hierarchy
Sounds like a system issue. Can we file radar and implement a workaround by creating a dummy web view and adding it to the view hierarchy?
Here is a document describing the problem, investigation results, and proposed solution: https://docs.google.com/document/d/1aPNO5p44T-LMQT1Mocdll-SG7xq_9DIjb4N0oOTHZUs/edit?usp=sharing

Project Member

Comment 16 by bugdroid1@chromium.org, Oct 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2a0b0bdb7bde74c10b3f7fdf15b41dec33c78273

commit 2a0b0bdb7bde74c10b3f7fdf15b41dec33c78273
Author: mrefaat <mrefaat@chromium.org>
Date: Tue Oct 16 19:22:06 2018

Fix NTP Omnibox suggestions not working with WKHTTPSystemCookieStore

Create a work around to force getAllCookies: completion handler to be executed
as soon as possible.
Workaround description and reasoning on the document:
https://docs.google.com/document/d/1aPNO5p44T-LMQT1Mocdll-SG7xq_9DIjb4N0oOTHZUs

Bug: 894540, 885218
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I94090ed1b6b6aa1dce3f764bfa46bc1d700ddf4d
Reviewed-on: https://chromium-review.googlesource.com/c/1281685
Commit-Queue: Mohammad Refaat <mrefaat@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600078}
[modify] https://crrev.com/2a0b0bdb7bde74c10b3f7fdf15b41dec33c78273/ios/web/net/cookies/wk_http_system_cookie_store.mm

Project Member

Comment 17 by bugdroid1@chromium.org, Oct 18

Labels: merge-merged-3578
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e39c97fd049ea8dfbc7d8f1c92847ddab49c036

commit 9e39c97fd049ea8dfbc7d8f1c92847ddab49c036
Author: mrefaat <mrefaat@chromium.org>
Date: Thu Oct 18 18:24:16 2018

[M71]Fix NTP Omnibox suggestions not working with WKHTTPSystemCookieStore

Create a work around to force getAllCookies: completion handler to be executed
as soon as possible.
Workaround description and reasoning on the document:
https://docs.google.com/document/d/1aPNO5p44T-LMQT1Mocdll-SG7xq_9DIjb4N0oOTHZUs

Bug: 894540, 885218
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I94090ed1b6b6aa1dce3f764bfa46bc1d700ddf4d
Reviewed-on: https://chromium-review.googlesource.com/c/1281685
Commit-Queue: Mohammad Refaat <mrefaat@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#600078}(cherry picked from commit 2a0b0bdb7bde74c10b3f7fdf15b41dec33c78273)
Reviewed-on: https://chromium-review.googlesource.com/c/1289087
Cr-Commit-Position: refs/branch-heads/3578@{#127}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}
[modify] https://crrev.com/9e39c97fd049ea8dfbc7d8f1c92847ddab49c036/ios/web/net/cookies/wk_http_system_cookie_store.mm

Verified on 71.0.3578.14 beta,  iPhoneX iOS 11.4.1, iPhone7 iOS 12.1 beta

Followed the steps on https://crbug.com/894540

Looks good.
We should use UMA to verify that cookie callback is always called.
I agree but we need at least 1 week of canary to be able to get some useful
information
Labels: Merge-Merged-71-3578
The following revision refers to this bug: 
https://chromium.googlesource.com/chromium/src.git/+/9e39c97fd049ea8dfbc7d8f1c92847ddab49c036

Commit: 9e39c97fd049ea8dfbc7d8f1c92847ddab49c036
Author: mrefaat@chromium.org
Commiter: mrefaat@chromium.org
Date: 2018-10-18 18:24:16 +0000 UTC

[M71]Fix NTP Omnibox suggestions not working with WKHTTPSystemCookieStore

Create a work around to force getAllCookies: completion handler to be executed
as soon as possible.
Workaround description and reasoning on the document:
https://docs.google.com/document/d/1aPNO5p44T-LMQT1Mocdll-SG7xq_9DIjb4N0oOTHZUs

Bug: 894540, 885218
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I94090ed1b6b6aa1dce3f764bfa46bc1d700ddf4d
Reviewed-on: https://chromium-review.googlesource.com/c/1281685
Commit-Queue: Mohammad Refaat <mrefaat@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#600078}(cherry picked from commit 2a0b0bdb7bde74c10b3f7fdf15b41dec33c78273)
Reviewed-on: https://chromium-review.googlesource.com/c/1289087
Cr-Commit-Position: refs/branch-heads/3578@{#127}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}

Sign in to add a comment