Skip to content

Port of fix for b/67042460 (retry more often before considering client offline) #403

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

Merged
merged 2 commits into from
Oct 23, 2017

Conversation

mikelehen
Copy link
Contributor

This ensures FSTRemoteStore always tries to connect at least twice before surfacing an FSTOnlineStateFailed event to external code (which may trigger gets to fail, cached data to be surfaced, etc.).

…t offline)

This ensures FSTRemoteStore always tries to connect at least twice before surfacing an FSTOnlineStateFailed
event to external code (which may trigger gets to fail, cached data to be surfaced, etc.).
Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

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

LGTM with a nit.

@@ -98,6 +106,9 @@ - (instancetype)initWithLocalStore:(FSTLocalStore *)localStore
*/
@property(nonatomic, assign) FSTOnlineState watchStreamOnlineState;

/** A count of consecutive failures to open the stream. */
@property(nonatomic, assign) NSUInteger watchStreamFailures;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should stick with avoiding these types unless we specifically need to interoperate with platform APIs that require their use. We should also avoid unsigned types unless we specifically need them: failure is very hard to detect.

Why not int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I copypasta'd NSUInteger from kMaxPendingWrites. I fixed that and the 2 usages I added.

@mikelehen mikelehen merged commit aab276a into master Oct 23, 2017
@mikelehen mikelehen deleted the mikelehen-retry-first-online-attempt branch October 23, 2017 17:10
minafarid pushed a commit to minafarid/firebase-ios-sdk that referenced this pull request Jun 6, 2018
…t offline) (firebase#403)

This ensures FSTRemoteStore always tries to connect at least twice before surfacing an FSTOnlineStateFailed
event to external code (which may trigger gets to fail, cached data to be surfaced, etc.).
@firebase firebase locked and limited conversation to collaborators Nov 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants