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

Android: fix cookies lost on Android 5.0 and above #19770

Closed
wants to merge 1 commit into from

Conversation

yuzhiyi
Copy link

@yuzhiyi yuzhiyi commented Jun 17, 2018

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

@facebook-github-bot
Copy link
Contributor

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!

@facebook-github-bot

This comment has been minimized.

@ghost
Copy link

ghost commented Jul 19, 2018

Can we please have this merged if it fixes the issue?

@hramos

This comment has been minimized.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 21, 2018
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@ghost
Copy link

ghost commented Jul 24, 2018

Can we merge this now?

@thecryptovalley

This comment has been minimized.

@hramos

This comment has been minimized.

@@ -129,6 +129,7 @@ public void run() {
for (String cookie : cookies) {
addCookieAsync(url, cookie);
}
getCookieManager().flush();
Copy link
Contributor

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?

Copy link
Author

@yuzhiyi yuzhiyi Sep 28, 2018

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

This comment was marked as off-topic.

@fangasvsass

This comment has been minimized.

@hramos

This comment has been minimized.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Sep 28, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@react-native-bot
Copy link
Collaborator

chenwenyu merged commit ea53727 into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 28, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 28, 2018
grabbou pushed a commit that referenced this pull request Oct 2, 2018
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
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
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
KusStar pushed a commit to KusStar/react-native that referenced this pull request Oct 28, 2020
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
KusStar pushed a commit to KusStar/react-native that referenced this pull request Oct 30, 2020
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants