Skip to content
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

Merged
merged 6 commits into from Nov 29, 2018

Conversation

brenca
Copy link
Contributor

@brenca brenca commented Nov 26, 2018

Description of Change

Fixes #15365, but the issue actually affected all cookies. This patch ensures that the cookie store is created properly.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines

Release Notes

Notes: Fixed a bug that made all cookies non persistent.

@brenca brenca requested a review from a team November 26, 2018 15:37
Copy link
Member

@deepak1556 deepak1556 left a 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!

@brenca
Copy link
Contributor Author

brenca commented Nov 26, 2018

@deepak1556 added a test for this

@brenca brenca force-pushed the brenca/cookie-store-backport branch from aacb472 to 3d180a7 Compare November 27, 2018 15:52
@brenca brenca force-pushed the brenca/cookie-store-backport branch from 3d180a7 to 76baa64 Compare November 27, 2018 21:08
@@ -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());
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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.

@ffflorian
Copy link
Contributor

Looking forward to this fix! Will this trigger a new beta release? 🙂

@brenca brenca force-pushed the brenca/cookie-store-backport branch from c6f22b4 to 776811c Compare November 29, 2018 17:11
@ckerr
Copy link
Member

ckerr commented Nov 29, 2018

We're already working on a new beta release, actually. There have been other tooling issues that are holding that up.

@codebytere codebytere merged commit 78b88a7 into master Nov 29, 2018
@release-clerk
Copy link

release-clerk bot commented Nov 29, 2018

Release Notes Persisted

Fixed a bug that made all cookies non persistent.

@codebytere codebytere deleted the brenca/cookie-store-backport branch November 29, 2018 18:51
@trop
Copy link
Contributor

trop bot commented Nov 29, 2018

I was unable to backport this PR to "4-0-x" cleanly;
you will need to perform this backport manually.

@javan
Copy link
Contributor

javan commented Nov 30, 2018

Looks like this change didn't make it into v4.0.0-beta.8, correct?

@brenca
Copy link
Contributor Author

brenca commented Dec 3, 2018

Yepp, should be in the next beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants