Skip to content

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

Merged
merged 4 commits into from
Sep 17, 2019

Conversation

schmidt-sebastian
Copy link
Contributor

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

Copy link

@thebrianchen thebrianchen left a 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'
// );
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@schmidt-sebastian schmidt-sebastian merged commit e24b1f4 into master Sep 17, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/fixregression branch October 10, 2019 22:55
@firebase firebase locked and limited conversation to collaborators Oct 17, 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.

4 participants