Skip to content

Key comparison for RTDB queries should correctly handle boundary sentinels #2328

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
Jan 15, 2021

Conversation

jmwski
Copy link
Contributor

@jmwski jmwski commented Jan 15, 2021

In order for startAfter and endBefore to have the correct ordering semantics, we need to return the objects MAX_KEY and MIN_KEY. Otherwise, the comparison function won't work properly in all cases:

https://github.com/firebase/firebase-android-sdk/blob/master/firebase-database/src/main/java/com/google/firebase/database/snapshot/ChildKey.java#L74-L76

@googlebot googlebot added the cla: yes Override cla label Jan 15, 2021
@google-cla google-cla bot added the cla: yes Override cla label Jan 15, 2021
@jmwski jmwski changed the title Fix ChildKey.fromString to return sentinel MAX_KEY/MIN_KEY Fix ChildKey.fromString to return boundary sentinels Jan 15, 2021
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jan 15, 2021

Coverage Report

Affected SDKs

  • firebase-database

    SDK overall coverage changed from 50.42% (998b18a) to 50.41% (aedfc809) by -0.01%.

    Filename Base (998b18a) Head (aedfc809) Diff
    SyncTree.java 62.99% 62.50% -0.49%
    ViewProcessor.java 91.79% 92.10% +0.30%

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (aedfc809) is created by Prow via merging commits: 998b18a 6f741f3.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jan 15, 2021

Binary Size Report

Affected SDKs

  • firebase-database

    Type Base (998b18a) Head (aedfc809) Diff
    aar 492 kB 492 kB +8 B (+0.0%)
    apk (release) 1.09 MB 1.09 MB -60 B (-0.0%)

Test Logs

Notes

Head commit (aedfc809) is created by Prow via merging commits: 998b18a 6f741f3.

Copy link
Contributor

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

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

Hm. Should we update the comparison function instead? This bug can show up in a number of places.

@jmwski jmwski changed the title Fix ChildKey.fromString to return boundary sentinels Key comparison for RTDB queries should correctly handle boundary sentinels Jan 15, 2021
@jmwski jmwski assigned schmidt-sebastian and unassigned jmwski Jan 15, 2021
@google-oss-bot
Copy link
Contributor

@IanWyszynski: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
device-check-changed 6f741f3 link /test device-check-changed
smoke-tests 6f741f3 link /test smoke-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@jmwski jmwski merged commit 6ccc9de into master Jan 15, 2021
@firebase firebase locked and limited conversation to collaborators Feb 15, 2021
@kaibolay kaibolay deleted the jw/filter-fixes branch September 14, 2022 17:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants