Skip to content

Add test for NoDocument assert #2205

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 1 commit into from
Sep 28, 2019
Merged

Add test for NoDocument assert #2205

merged 1 commit into from
Sep 28, 2019

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Sep 28, 2019

This PR adds a test for the assert that caused the Index-Free rollback on Android (b/141011925).

The customer got back to me (in person at the Firebase Summit) and their stacktrace is actually from MemoryPersistence. With MemoryPersistence it is actually much more likely to hit the scenario that we discussed as the possible culprit (in LocalStore.applyRemoteEvent):

if (existingDoc == null) {
  // This is the path that causes the assert. A failed limbo resolution added a 
  // NoDocument, but the limbo resolution fails when we have already deleted
  // the offending document from cache.
} else if (doc instanceof NoDocument) {
  // This is the good path 
}

With EagerGC, existingDoc is null if we already unlistened from the query that originally returned it when the Limbo resolution fails (or if we remove a mutation that depended on it).

The test hits the assert in the original code, but passes since we merged #2176

Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

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

Oh niiiiiiiice. I knew we sent you to Fireconf for a reason!

Thanks for writing the test and adding the excellent comments in the test explaining what's going on. 👍

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

2 participants