Bug 186205 - REGRESSION (r229872): Unable to log into twitter.com in private sessions
Summary: REGRESSION (r229872): Unable to log into twitter.com in private sessions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar, Regression
: 186617 (view as bug list)
Depends on: 183921
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-01 13:18 PDT by Chris Dumez
Modified: 2018-10-02 19:25 PDT (History)
11 users (show)

See Also:


Attachments
Patch (15.06 KB, patch)
2018-06-01 13:45 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (15.76 KB, patch)
2018-06-01 15:16 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-06-01 13:18:28 PDT
Unable to log into twitter.com in private sessions since http://trac.webkit.org/r230567.
Comment 1 Chris Dumez 2018-06-01 13:18:44 PDT
<rdar://problem/40670799>
Comment 2 Chris Dumez 2018-06-01 13:45:27 PDT
Created attachment 341783 [details]
Patch
Comment 3 youenn fablet 2018-06-01 14:42:49 PDT
Comment on attachment 341783 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=341783&action=review

> Source/WebCore/workers/service/server/SWServer.cpp:-75
> -    RELEASE_ASSERT(m_jobQueues.isEmpty());

Shouldn't we also remove the first assert?

> Source/WebKit/UIProcess/WebProcessPool.cpp:734
> +    }

You might be able to use sendToNetworkingProcess/sendToStorageProcess to improve the readability.
Something like:
if (privateBrowsingEnabled) {
   ...
   return;
}

sendToNetworkingProcess(Messages::NetworkProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()), 0);
sendToStorageProcess(Messages::StorageProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()), 0);
sendToAllProcesses(Messages::WebProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()));

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1482
> +            weakThis->removePrevalentDomains(domainsToRemove);

Lambdas do not seem to make things better here.
How about passing the weakThis once to WebResourceLoadStatisticsStore, which could then call the removePrevalentDomains/removeAllStorageAccessHandler/grantStorageAccessHandler/... methods directly.
Comment 4 Chris Dumez 2018-06-01 14:45:16 PDT
Comment on attachment 341783 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=341783&action=review

>> Source/WebCore/workers/service/server/SWServer.cpp:-75
>> -    RELEASE_ASSERT(m_jobQueues.isEmpty());
> 
> Shouldn't we also remove the first assert?

I am not sure. It seems to work. When a session is destroyed, all its web processes should have been destroyed so we should no longer have connections to them.

>> Source/WebKit/UIProcess/WebProcessPool.cpp:734
>> +    }
> 
> You might be able to use sendToNetworkingProcess/sendToStorageProcess to improve the readability.
> Something like:
> if (privateBrowsingEnabled) {
>    ...
>    return;
> }
> 
> sendToNetworkingProcess(Messages::NetworkProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()), 0);
> sendToStorageProcess(Messages::StorageProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()), 0);
> sendToAllProcesses(Messages::WebProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()));

Ok.

>> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1482
>> +            weakThis->removePrevalentDomains(domainsToRemove);
> 
> Lambdas do not seem to make things better here.
> How about passing the weakThis once to WebResourceLoadStatisticsStore, which could then call the removePrevalentDomains/removeAllStorageAccessHandler/grantStorageAccessHandler/... methods directly.

This is a larger refactoring. I'll try and see how big it ends up being.
Comment 5 Chris Dumez 2018-06-01 15:16:02 PDT
Created attachment 341793 [details]
Patch
Comment 6 WebKit Commit Bot 2018-06-01 15:56:35 PDT
Comment on attachment 341793 [details]
Patch

Clearing flags on attachment: 341793

Committed r232423: <https://trac.webkit.org/changeset/232423>
Comment 7 WebKit Commit Bot 2018-06-01 15:56:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Chris Dumez 2018-06-14 11:56:10 PDT
*** Bug 186617 has been marked as a duplicate of this bug. ***
Comment 9 shalin_i_parmar 2018-10-02 18:42:42 PDT
I still see that this issue is happening for all Safari browsers and it is not consistent, i.e. it send with most of GET requests but not all.

In two of our apps, we see that the request was not being sent with cookies at all for variety of requests including GET and POST.

Please fix this as it is very annoying and hard to detect.