Skip to content

Clear the lastLimboFreeSnapshot version on existence filter mismatch #3267

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 6 commits into from
Jan 4, 2022

Conversation

schmidt-sebastian
Copy link
Contributor

This fixes a problem where the SDK receives an existence filter mismatch and clears the mapping of documents to targets, but does not receive another snapshot that also clears the snapshot version (i.e. the device went in the background and did was not able to actually process a re-run of the query).

The change that this PR makes is that we always reset the lastLimboFreeSnapshot version to 0 if we get a target mismatch.

Fixes #3249

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 23, 2021

Coverage Report 1

Affected Products

  • firebase-firestore

    Overall coverage changed from 45.25% (6178b13) to 45.25% (de1047d) by +0.00%.

    FilenameBase (6178b13)Merge (de1047d)Diff
    DeleteMutation.java95.00%90.00%-5.00%
    LocalStore.java99.37%99.37%+0.00%

Test Logs

Notes

  • Commit (de1047d) is created by Prow via merging PR base commit (6178b13) and head commit (05339bc).
  • Run gradle <product>:checkCoverage to produce HTML coverage reports locally. After gradle commands finished, report files can be found under <product-build-dir>/reports/jacoco/.

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/9Xm6NXqOJn.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 23, 2021

Size Report 1

Affected Products

  • firebase-firestore

    TypeBase (6178b13)Merge (de1047d)Diff
    aar1.23 MB1.23 MB+4 B (+0.0%)
    apk (release)3.33 MB3.33 MB-104 B (-0.0%)

Test Logs

Notes

  • Commit (de1047d) is created by Prow via merging PR base commit (6178b13) and head commit (05339bc).

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/btkgUkBVkZ.html

@schmidt-sebastian
Copy link
Contributor Author

/test device-check-changed

1 similar comment
@schmidt-sebastian
Copy link
Contributor Author

/test device-check-changed

Copy link
Contributor

@bswhite1 bswhite1 left a comment

Choose a reason for hiding this comment

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

Should the test case in existence_spec_test.json, or somewhere else, check that the targetData.lastLimboFreeSnapshotVersion is reset to none?

Other than that, the code itself is good. I verified via several test runs and never saw the error.

@schmidt-sebastian
Copy link
Contributor Author

@bswhite1 Thanks for verifying. I also added another test case.

Copy link
Contributor

@bswhite1 bswhite1 left a comment

Choose a reason for hiding this comment

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

Looks good.

What is the easiest way to determine when this is part of a release?
Do you ever use git Tags, or release branches?

@schmidt-sebastian
Copy link
Contributor Author

Please take a look at our release notes to determine what is contained in a release. This PR should be included in the next cut.

We use a private GitHub repository to manage our releases. The tags are not visible here.

@@ -7,6 +7,8 @@ by opting into a release at
updates that have not yet been synced with the backend.
- [changed] Improved performance for queries against collections that contain
subcollections.
- [fixed] Fixed an issue that may have caused the SDK to raise incomplete
Copy link
Contributor

Choose a reason for hiding this comment

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

"may have caused" sounds to me like you are unsure that this is the root cause; however, it seems that the root cause is definitively known. Would it make sense to re-word this to imply that the buggy behavior is intermittent?

e.g. Fixed an issue that causes the SDK to sometimes raise incomplete snapshots...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Will update

@schmidt-sebastian schmidt-sebastian merged commit 618b08c into master Jan 4, 2022
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/clearresumetoken branch January 4, 2022 22:35
@firebase firebase locked and limited conversation to collaborators Feb 4, 2022
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.

Query snapshots not updating after returning to foreground
4 participants