-
Notifications
You must be signed in to change notification settings - Fork 627
Skip backoff when App enters Foreground #2693
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
7ec8cec
to
dca9259
Compare
Binary Size ReportAffected SDKs
Test Logs
NotesHead commit (fe634292) is created by Prow via merging commits: b5d06cd dca9259. |
Macrobenchmark ReportAffected SDKsMeasurements are for head commit (dca9259). Diffing against base commit (b5d06cd) is working in progress.
|
@Override | ||
public void onBackgroundStateChanged(boolean background) { | ||
if (!background && isConnected()) { | ||
raiseCallbacks(/* connected= */ true); |
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.
Is invoking the callbacks enough to reset the backoff? (I presume it is, just checking)
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.
Yeah, they already call inhibitBackoff
.
We might lose network connectivity when a Firestore app is backgrounded. This PR changes our network monitor to skip the backoff when an app goes back in the foreground, which causes the SDK to immediately try to reconnect.
Tested manually.
Fixes #2637