-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Android: fix cookies lost on Android 5.0 and above #19770
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
This comment has been minimized.
This comment has been minimized.
Can we please have this merged if it fixes the issue? |
This comment has been minimized.
This comment has been minimized.
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Can we merge this now? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -129,6 +129,7 @@ public void run() { | |||
for (String cookie : cookies) { | |||
addCookieAsync(url, cookie); | |||
} | |||
getCookieManager().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.
It looks like the cookies are added asynchronously. Can we guarantee cookies have finished being added before they are flushed / written to permanent storage?
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.
Yes. Cookies have been obtained before being flushed to disk.
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.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
chenwenyu merged commit ea53727 into |
Summary: This fixes cookie missing bug on Android 5.0 and above. On Android 5.0 and above, after the app successfully obtains the cookie, you kills the App within 30 seconds and restarts the App. It accesses the interface that needs to carry the cookie and finds that the cookie does not exist. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. [ANDROID] [BUGFIX] [Cookie] - Fix cookies lost on Android 5.0 and above Pull Request resolved: #19770 Differential Revision: D10114102 Pulled By: hramos fbshipit-source-id: 5b4766f02f70541fd46ac5db36f1179fe386ac7a
Summary: This fixes cookie missing bug on Android 5.0 and above. On Android 5.0 and above, after the app successfully obtains the cookie, you kills the App within 30 seconds and restarts the App. It accesses the interface that needs to carry the cookie and finds that the cookie does not exist. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. [ANDROID] [BUGFIX] [Cookie] - Fix cookies lost on Android 5.0 and above Pull Request resolved: facebook#19770 Differential Revision: D10114102 Pulled By: hramos fbshipit-source-id: 5b4766f02f70541fd46ac5db36f1179fe386ac7a
Summary: This fixes cookie missing bug on Android 5.0 and above. On Android 5.0 and above, after the app successfully obtains the cookie, you kills the App within 30 seconds and restarts the App. It accesses the interface that needs to carry the cookie and finds that the cookie does not exist. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. [ANDROID] [BUGFIX] [Cookie] - Fix cookies lost on Android 5.0 and above Pull Request resolved: facebook#19770 Differential Revision: D10114102 Pulled By: hramos fbshipit-source-id: 5b4766f02f70541fd46ac5db36f1179fe386ac7a
Summary: This fixes cookie missing bug on Android 5.0 and above. On Android 5.0 and above, after the app successfully obtains the cookie, you kills the App within 30 seconds and restarts the App. It accesses the interface that needs to carry the cookie and finds that the cookie does not exist. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior. [ANDROID] [BUGFIX] [Cookie] - Fix cookies lost on Android 5.0 and above Pull Request resolved: facebook#19770 Differential Revision: D10114102 Pulled By: hramos fbshipit-source-id: 5b4766f02f70541fd46ac5db36f1179fe386ac7a
This fixes cookie missing bug on Android 5.0 and above.
On Android 5.0 and above, after the app successfully obtains the cookie, you kills the App within 30 seconds and restarts the App. It accesses the interface that needs to carry the cookie and finds that the cookie does not exist.
Test Plan
Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior.
Related PRs
Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior.
Release Notes
[ANDROID] [BUGFIX] [Cookie] - Fix cookies lost on Android 5.0 and above