Skip to content
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

Simplify code and improve test coverage #7512

Merged
merged 5 commits into from
Aug 8, 2023

Conversation

milaGGL
Copy link
Contributor

@milaGGL milaGGL commented Aug 1, 2023

  • simplify the code to get inequality fields
  • add unit tests for implicit ordering on inequality fields
  • remove unnecessary validation tests on multiple inequality

TODO: next PR

  • modify the test for aggregate query
  • add negative test cases

@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2023

⚠️ No Changeset found

Latest commit: bdcfeb6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@milaGGL milaGGL changed the base branch from master to mila/Multiple-Inequality-support August 1, 2023 18:45
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 1, 2023

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (63698a7)Merge (381a1ac)Diff
    browser369 kB369 kB-140 B (-0.0%)
    esm5355 kB355 kB-218 B (-0.1%)
    main568 kB567 kB-172 B (-0.0%)
    module369 kB369 kB-140 B (-0.0%)
    react-native369 kB369 kB-140 B (-0.0%)
  • @firebase/firestore-lite

    TypeBase (63698a7)Merge (381a1ac)Diff
    browser109 kB109 kB-140 B (-0.1%)
    esm5106 kB106 kB-218 B (-0.2%)
    main149 kB149 kB-172 B (-0.1%)
    module109 kB109 kB-140 B (-0.1%)
    react-native109 kB109 kB-140 B (-0.1%)
  • bundle

    TypeBase (63698a7)Merge (381a1ac)Diff
    firestore (Persistence)301 kB301 kB-140 B (-0.0%)
    firestore (Query Cursors)238 kB238 kB-140 B (-0.1%)
    firestore (Query)236 kB235 kB-140 B (-0.1%)
    firestore (Read data once)224 kB224 kB-140 B (-0.1%)
    firestore (Realtime updates)226 kB226 kB-140 B (-0.1%)
    firestore (Transaction)203 kB202 kB-140 B (-0.1%)
    firestore (Write data)202 kB202 kB-140 B (-0.1%)
    firestore-lite (Query Cursors)89.0 kB88.8 kB-140 B (-0.2%)
    firestore-lite (Query)85.1 kB85.0 kB-140 B (-0.2%)
  • firebase

    TypeBase (63698a7)Merge (381a1ac)Diff
    firebase-compat.js773 kB773 kB-136 B (-0.0%)
    firebase-firestore-compat.js339 kB339 kB-136 B (-0.0%)
    firebase-firestore-lite.js116 kB116 kB-140 B (-0.1%)
    firebase-firestore.js429 kB429 kB-140 B (-0.0%)

Test Logs

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

@@ -777,6 +778,82 @@ describe('Query', () => {
);
});

it("generates the correct implicit order by's for multiple inequality", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Thanks

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 1, 2023

Size Analysis Report 1

Affected Products

  • @firebase/firestore

    • QueryCompositeFilterConstraint

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size20.0 kB19.9 kB-87 B (-0.4%)
      size-with-ext-deps89.6 kB89.5 kB-87 B (-0.1%)
    • QueryEndAtConstraint

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size43.3 kB43.3 kB+7 B (+0.0%)
      size-with-ext-deps113 kB113 kB+7 B (+0.0%)
    • QueryFieldFilterConstraint

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size41.3 kB41.2 kB-60 B (-0.1%)
      size-with-ext-deps111 kB111 kB-60 B (-0.1%)
    • QueryStartAtConstraint

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size43.3 kB43.3 kB+7 B (+0.0%)
      size-with-ext-deps113 kB113 kB+7 B (+0.0%)
    • addDoc

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size122 kB122 kB-140 B (-0.1%)
      size-with-ext-deps192 kB192 kB-140 B (-0.1%)
    • aggregateQuerySnapshotEqual

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size40.7 kB40.6 kB-140 B (-0.3%)
      size-with-ext-deps111 kB111 kB-140 B (-0.1%)
    • and

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size42.7 kB42.6 kB-147 B (-0.3%)
      size-with-ext-deps112 kB112 kB-147 B (-0.1%)
    • deleteDoc

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size113 kB113 kB-140 B (-0.1%)
      size-with-ext-deps183 kB183 kB-140 B (-0.1%)
    • disableNetwork

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size101 kB101 kB-140 B (-0.1%)
      size-with-ext-deps171 kB171 kB-140 B (-0.1%)
    • enableIndexedDbPersistence

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size184 kB184 kB-140 B (-0.1%)
      size-with-ext-deps255 kB255 kB-140 B (-0.1%)
    • enableMultiTabIndexedDbPersistence

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size221 kB220 kB-140 B (-0.1%)
      size-with-ext-deps292 kB292 kB-140 B (-0.0%)
    • enableNetwork

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size101 kB101 kB-140 B (-0.1%)
      size-with-ext-deps171 kB171 kB-140 B (-0.1%)
    • endAt

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size43.3 kB43.3 kB+7 B (+0.0%)
      size-with-ext-deps113 kB113 kB+7 B (+0.0%)
    • endBefore

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size43.3 kB43.3 kB+7 B (+0.0%)
      size-with-ext-deps113 kB113 kB+7 B (+0.0%)
    • executeWrite

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size112 kB112 kB-140 B (-0.1%)
      size-with-ext-deps182 kB182 kB-140 B (-0.1%)
    • getAggregateFromServer

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size108 kB108 kB-140 B (-0.1%)
      size-with-ext-deps179 kB178 kB-140 B (-0.1%)
    • getCountFromServer

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size108 kB108 kB-140 B (-0.1%)
      size-with-ext-deps179 kB179 kB-140 B (-0.1%)
    • getDoc

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size143 kB143 kB-140 B (-0.1%)
      size-with-ext-deps213 kB213 kB-140 B (-0.1%)
    • getDocFromCache

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size93.5 kB93.3 kB-140 B (-0.1%)
      size-with-ext-deps163 kB163 kB-140 B (-0.1%)
    • getDocFromServer

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size143 kB143 kB-140 B (-0.1%)
      size-with-ext-deps213 kB213 kB-140 B (-0.1%)
    • getDocs

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size145 kB145 kB-140 B (-0.1%)
      size-with-ext-deps215 kB215 kB-140 B (-0.1%)
    • getDocsFromCache

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size101 kB101 kB-140 B (-0.1%)
      size-with-ext-deps171 kB171 kB-140 B (-0.1%)
    • getDocsFromServer

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size144 kB144 kB-140 B (-0.1%)
      size-with-ext-deps215 kB215 kB-140 B (-0.1%)
    • loadBundle

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size111 kB111 kB-140 B (-0.1%)
      size-with-ext-deps181 kB181 kB-140 B (-0.1%)
    • memoryEagerGarbageCollector

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size84.0 kB83.9 kB-140 B (-0.2%)
      size-with-ext-deps154 kB154 kB-140 B (-0.1%)
    • memoryLocalCache

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size98.3 kB98.2 kB-140 B (-0.1%)
      size-with-ext-deps169 kB168 kB-140 B (-0.1%)
    • memoryLruGarbageCollector

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size90.5 kB90.4 kB-140 B (-0.2%)
      size-with-ext-deps160 kB160 kB-140 B (-0.1%)
    • namedQuery

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size86.9 kB86.8 kB-140 B (-0.2%)
      size-with-ext-deps157 kB157 kB-140 B (-0.1%)
    • onSnapshot

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size145 kB145 kB-140 B (-0.1%)
      size-with-ext-deps216 kB215 kB-140 B (-0.1%)
    • onSnapshotsInSync

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size135 kB135 kB-140 B (-0.1%)
      size-with-ext-deps205 kB205 kB-140 B (-0.1%)
    • or

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size42.7 kB42.6 kB-147 B (-0.3%)
      size-with-ext-deps112 kB112 kB-147 B (-0.1%)
    • persistentLocalCache

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size181 kB181 kB-140 B (-0.1%)
      size-with-ext-deps253 kB252 kB-140 B (-0.1%)
    • persistentMultipleTabManager

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size217 kB217 kB-140 B (-0.1%)
      size-with-ext-deps289 kB289 kB-140 B (-0.0%)
    • persistentSingleTabManager

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size181 kB180 kB-140 B (-0.1%)
      size-with-ext-deps252 kB252 kB-140 B (-0.1%)
    • query

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size43.0 kB42.8 kB-147 B (-0.3%)
      size-with-ext-deps113 kB113 kB-147 B (-0.1%)
    • queryEqual

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size40.6 kB40.5 kB-140 B (-0.3%)
      size-with-ext-deps110 kB110 kB-140 B (-0.1%)
    • runTransaction

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size122 kB122 kB-140 B (-0.1%)
      size-with-ext-deps192 kB192 kB-140 B (-0.1%)
    • setDoc

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size121 kB121 kB-140 B (-0.1%)
      size-with-ext-deps191 kB191 kB-140 B (-0.1%)
    • setIndexConfiguration

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size89.6 kB89.4 kB-140 B (-0.2%)
      size-with-ext-deps159 kB159 kB-140 B (-0.1%)
    • snapshotEqual

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size46.3 kB46.1 kB-140 B (-0.3%)
      size-with-ext-deps116 kB116 kB-140 B (-0.1%)
    • startAfter

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size43.3 kB43.3 kB+7 B (+0.0%)
      size-with-ext-deps113 kB113 kB+7 B (+0.0%)
    • startAt

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size43.3 kB43.3 kB+7 B (+0.0%)
      size-with-ext-deps113 kB113 kB+7 B (+0.0%)
    • updateDoc

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size122 kB121 kB-140 B (-0.1%)
      size-with-ext-deps192 kB192 kB-140 B (-0.1%)
    • waitForPendingWrites

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size102 kB102 kB-140 B (-0.1%)
      size-with-ext-deps172 kB172 kB-140 B (-0.1%)
    • where

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size42.1 kB42.0 kB-60 B (-0.1%)
      size-with-ext-deps112 kB112 kB-60 B (-0.1%)
    • writeBatch

      Size

      TypeBase (63698a7)Merge (381a1ac)Diff
      size124 kB123 kB-140 B (-0.1%)
      size-with-ext-deps194 kB194 kB-140 B (-0.1%)

Test Logs

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

@milaGGL milaGGL changed the title Mila/polish up tests simplify code and add test coverage Aug 1, 2023
@milaGGL milaGGL marked this pull request as ready for review August 1, 2023 21:09
@milaGGL milaGGL requested review from a team as code owners August 1, 2023 21:09
@milaGGL milaGGL requested a review from ehsannas August 1, 2023 21:09
@milaGGL milaGGL changed the title simplify code and add test coverage Simplify code and improve test coverage Aug 3, 2023
@milaGGL milaGGL merged commit 59796bc into mila/Multiple-Inequality-support Aug 8, 2023
@milaGGL milaGGL deleted the mila/polish-up-tests branch August 8, 2023 14:27
@firebase firebase locked and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants