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 For Android Device Connection To Firestore #17449

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Libraries/Core/Timers/JSTimers.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ const IDLE_CALLBACK_FRAME_DEADLINE = 1;

const MAX_TIMER_DURATION_MS = 60 * 1000;
const IS_ANDROID = Platform.OS === 'android';
const ANDROID_LONG_TIMER_MESSAGE =
'Setting a timer for a long period of time, i.e. multiple minutes, is a ' +
'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)';

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.

Copy link
Contributor Author

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...

// Parallel arrays
const callbacks: Array<?Function> = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void onProgress(long bytesWritten, long contentLength, boolean done) {
String contentEncoding = requestHeaders.get(CONTENT_ENCODING_HEADER_NAME);
requestBuilder.headers(requestHeaders);

if (data == null) {
if (data == null || method.toLowerCase().equals("get") || method.toLowerCase().equals("head")) {
requestBuilder.method(method, RequestBodyUtil.getEmptyBody(method));
} else if (data.hasKey(REQUEST_BODY_KEY_STRING)) {
if (contentType == null) {
Expand Down