Bug 188209

Summary: [Cocoa] setCookie API fails to set session cookies for defaultDataStore if processPool created but not used
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: New BugsAssignee: Sihui Liu <sihui_liu>
Status: REOPENED ---    
Severity: Normal CC: achristensen, cdumez, commit-queue, ews-watchlist, ggaren, realdawei, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews205 for win-future none

Description Sihui Liu 2018-07-31 16:34:48 PDT
Steps to reproduce:
1. Create a WKWebViewConfiguration configuration
2. Set processPool for configuration
3. Set a session cookie for domain apple.com to defaultDataStore
4. Create a webView with the configuration
5. Load apple.com in the webView, and check if the session cookie is in cookie storage via web inspector
Comment 1 Sihui Liu 2018-07-31 17:00:17 PDT
Created attachment 346227 [details]
Patch
Comment 2 EWS Watchlist 2018-07-31 23:31:23 PDT
Comment on attachment 346227 [details]
Patch

Attachment 346227 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8720650

New failing tests:
imported/blink/transitions/unprefixed-transform.html
legacy-animation-engine/imported/blink/transitions/unprefixed-transform.html
Comment 3 EWS Watchlist 2018-07-31 23:31:35 PDT
Created attachment 346262 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 4 Geoffrey Garen 2018-08-02 13:08:30 PDT
Comment on attachment 346227 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2018-08-02 15:18:42 PDT
Comment on attachment 346227 [details]
Patch

Clearing flags on attachment: 346227

Committed r234517: <https://trac.webkit.org/changeset/234517>
Comment 6 WebKit Commit Bot 2018-08-02 15:18:44 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-08-02 15:20:20 PDT
<rdar://problem/42875686>
Comment 8 Dawei Fenton (:realdawei) 2018-08-03 08:41:55 PDT
(In reply to WebKit Commit Bot from comment #5)
> Comment on attachment 346227 [details]
> Patch
> 
> Clearing flags on attachment: 346227
> 
> Committed r234517: <https://trac.webkit.org/changeset/234517>

Looks like this change broke API tests on iOS

https://build.webkit.org/builders/Apple%20iOS%2011%20Simulator%20Release%20WK2%20(Tests)/builds/6594/steps/run-api-tests/logs/stdio
  TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool
        
        /Volumes/Data/slave/ios-simulator-11-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:473
        Value of: message.UTF8String
          Actual: "SessionCookieName=CookieValue"
        Expected: "PersistentCookieName=CookieValue; SessionCookieName=CookieValue"
Comment 9 Dawei Fenton (:realdawei) 2018-08-03 16:01:42 PDT
Reverted r234517 for reason:

Caused API test failures on iOS

Committed r234561: <https://trac.webkit.org/changeset/234561>
Comment 10 Sihui Liu 2018-08-06 10:12:13 PDT
The test is failing because: for an existing processPool, registerForNewProcessPoolNotifications won't be called, so we don't do flushCookieStore and persistent cookies are not written to file for synchronization.

We could do a workaround fix for this, but since we are going to do a complete fix by always launching network process whenever needed, and this bug seems to have little impact now. I think we could hold it for later.