-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 For Android Device Connection To Firestore #17449
Conversation
This commit is based on a suggestion made by a Firebase member facebook#17083. Longer timers are used in critical parts of Firebase-SDK such as refreshing the token; Its a bad user experience if the token expires and users need to keep login to the application! We appreciate your cooperation.
The following change is suggested by a Firebase member here. firebase/firebase-js-sdk#283 It follows the whatwg.org's send method guidelines. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send At the section 3 of 4.5.6, it is suggests to check for the GET or HEAD methods, for every XMLHttpRequest send() method, then set the body to null if it is true.
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! |
Attention: @shergin, @mhorowitz, @janicduplessis, @hramos, @grabbou, @Kureev Generated by 🚫 dangerJS |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
'performance and correctness issue on Android as it keeps the timer ' + | ||
'module awake, and timers can only be called when the app is in the foreground. ' + | ||
'See https://github.com/facebook/react-native/issues/12981 for more info.'; | ||
const ANDROID_LONG_TIMER_MESSAGE = '(ADVICE)'; | ||
|
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 think you may want to keep the message and just prefix as "(ADVICE) Setting a timer ..." I believe that means it'll get logged to the console but won't show up in your app with the yellow warning box.
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 honestly couldn't justify the need of it being logged to the console, that's why i deleted it; I think we may have to submit two seperate PRs, since these commits are kind of mutually exclusive, even though I initially thought they are related! Lets wait until they get back to us...
@samsafay I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
@janicduplessis Can you take a look at this commit? |
The PR is in a weird state, could you fix it or just reopen a new one? |
@janicduplessis I am going to reopen a new one, just disregard this one. |
@janicduplessis I have added a new PR here #17940. Sorry for the confusion! |
Motivation
React Native had an underlying problem connecting to Firestore (Google's latest database) from Android devices. You can follow the issue here.
The main problem was in NetworkingModule.java. I have already explained it on the commit a55fe37.
Test Plan
In this video, I am showing how the react native behaved before adding the new fix and how it worked after the new fix added. The new fix starts at 50 seconds.
Release Notes
[ANDROID] [BUGFIX] [FIRESTORE][XMLHttpRequest][ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java] - Fixes the connection to Firestore by following whatwg.org's XMLHttpRequest send() method