-
Notifications
You must be signed in to change notification settings - Fork 615
Fix Android connectivity issues #937
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
Conversation
282369a
to
448311d
Compare
/retest |
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/FirestoreChannel.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/FirestoreChannel.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/GrpcCallProvider.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/OnlineStateTracker.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/util/ExponentialBackoff.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/OnlineStateTracker.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/AbstractStream.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/AbstractStream.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/AbstractStream.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java
Outdated
Show resolved
Hide resolved
…dk into bc/reconnect
/test check-changed |
/test smoke-tests |
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/FirestoreChannel.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/FirestoreChannel.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/OnlineStateTracker.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/OnlineStateTracker.java
Show resolved
Hide resolved
() -> { | ||
// If the network has been explicitly disabled, make sure we don't accidentally | ||
// re-enable it. | ||
if (canUseNetwork()) { |
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.
Previously, in the case of an online state timeout we performed the following things:
logClientOfflineWarningIfNecessary(
String.format(
Locale.ENGLISH,
"Backend didn't respond within %d seconds\n",
ONLINE_STATE_TIMEOUT_MS / 1000));
setAndBroadcastState(OnlineState.OFFLINE);
This isn't calling handleWatchStreamFailure
so how is the OnlineState supposed to get to OFFLINE after the first timeout?
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.
handleWatchStreamFailure
is still being called:
attemptReconnect()
results in callingAbstractStream.close()
close()
calls theonClose()
listener passed in, which callsRemoteStore.handleWatchStreamClose()
handleWatchStreamClose()
callshandleWatchStreamFailure()
.
The problem I was running into by leaving a handleWatchStreamFailure()
in the timeout logic was that handleWatchStreamFailure()
would be called twice, once in the timer timeout, and once in handleWatchStreamClose()
. Calling attemptReconnect()
would call handleWatchStreamFailure()
followed by a call to startWatchStream()
. The subsequent call to handleWatchStreamFailure()
in the timeout logic would then clear the connectivity timer set by attemptReconnect()
.
firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java
Outdated
Show resolved
Hide resolved
/retest |
/test smoke-tests |
1 similar comment
/test smoke-tests |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
c01918a
to
b77e02e
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Fixes b/141865469.
onClose()
handler tostart()
.Updated (11/12):
CONNECTIVITY_ATTEMPT_TIMEOUT
andONLINE_STATE_TIMEOUT
to track transition vs. retry attempts.