-
Notifications
You must be signed in to change notification settings - Fork 944
Change the order of checks in applyRemoteEvent() #2176
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
1cd68b1
to
402fd3b
Compare
402fd3b
to
3ec6996
Compare
3ec6996
to
cbf0abe
Compare
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.
lgtm
// assert( | ||
// !SnapshotVersion.MIN.isEqual(remoteEvent.snapshotVersion), | ||
// 'Cannot add a document when the remote version is zero' | ||
// ); |
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.
What do you think of adding this now but as a non-fatal error log statement that suggests people file a github issue (or maybe we should open a tracking issue now and just ask people to add a comment, just in case a massive number of people hit the log statement)? That would give us some extra confidence that we won't hit issues when we add the assert for real.
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.
That's a great idea. I changed this to a logline right now, and hope that people will flock to GitHub if they see this. We probably want to do the same from Android if we don't get reproduction steps before the next code freeze.
If there is a chance that a limbo resolution fails for a document that no longer exists, we could get into a state where we write a document into the RemoteDocumentCache with a snapshot version of zero. By re-ordering the statements, we make sure this does not happen
Port of firebase/firebase-android-sdk#802