New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: backport patch that ensures that cookie store is always created #15836
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, would be great to have a test for this. Thanks!
@deepak1556 added a test for this |
aacb472
to
3d180a7
Compare
3d180a7
to
76baa64
Compare
@@ -259,6 +262,11 @@ void URLRequestContextGetter::NotifyContextShuttingDown( | |||
std::unique_ptr<ResourceContext> resource_context) { | |||
DCHECK_CURRENTLY_ON(BrowserThread::IO); | |||
|
|||
// todo(brenca): remove once C70 lands | |||
if (url_request_context_ && url_request_context_->cookie_store()) { | |||
url_request_context_->cookie_store()->FlushStore(base::NullCallback()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary ? I was able to confirm that cookies are persisted without any external flushing. My test scenario was, from a clean app state.
- visit https://github.com and sign-in
- exit app and restart
- account remains signed-in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, not sure what's going on here - the test that I added passes without the explicit flush, but the test app I used doesn't keep the cookies. Can you check if this works on your machine? https://gist.github.com/brenca/205ea1876c844b4a6eec58ee735f6537
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm if the app is quit immediately the cookie is not persisted, must be the persistent db write period https://cs.chromium.org/chromium/src/net/extras/sqlite/sqlite_persistent_cookie_store.cc?l=1277, seems good to have an external flush.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepak1556 @brenca is this ready to merge or do more changes need to be made?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am good with the current patch, needs to be rebased to fix conflicts before merge.
Looking forward to this fix! Will this trigger a new beta release? 🙂 |
Co-Authored-By: brenca <benecene@gmail.com>
Co-Authored-By: brenca <benecene@gmail.com>
c6f22b4
to
776811c
Compare
We're already working on a new beta release, actually. There have been other tooling issues that are holding that up. |
Release Notes Persisted
|
I was unable to backport this PR to "4-0-x" cleanly; |
Looks like this change didn't make it into v4.0.0-beta.8, correct? |
Yepp, should be in the next beta. |
Description of Change
Fixes #15365, but the issue actually affected all cookies. This patch ensures that the cookie store is created properly.
Checklist
npm test
passesRelease Notes
Notes: Fixed a bug that made all cookies non persistent.