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

Firestore: use string values for TargetPurpose enum #7257

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Apr 24, 2023

Firestore: Use string values for TargetPurpose enum, rather than numeric.

Although string values can assist with debugging, the main purpose is so that the spec tests will generate JSON for the Android and iOS SDKs that is stable and readable.

A previous PR, #7229, added TargetPurpose.ExistenceFilterMismatchBloom which caused TargetPurpose.LimboResolution to change its value from 2 to 3. This did not cause any problems in this SDK; however, it broke the spec tests in the Android SDK (and probably the ios sdk too). By hardcoding the values as strings it is both more readable and more stable.

Android port: firebase/firebase-android-sdk#4931
iOS port: firebase/firebase-ios-sdk#11191

@dconeybe dconeybe requested a review from a team as a code owner April 24, 2023 20:15
@dconeybe dconeybe self-assigned this Apr 24, 2023
@dconeybe dconeybe requested a review from a team as a code owner April 24, 2023 20:15
@changeset-bot
Copy link

changeset-bot bot commented Apr 24, 2023

⚠️ No Changeset found

Latest commit: 5e43cd8

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

@dconeybe dconeybe changed the title Firestore: target_data.ts: use string values for TargetPurpose enum, … Firestore: use string values for TargetPurpose enum Apr 24, 2023
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 24, 2023

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (510c9b5)Merge (ec2fa04)Diff
    browser285 kB285 kB+301 B (+0.1%)
    esm5354 kB354 kB+301 B (+0.1%)
    main566 kB567 kB+301 B (+0.1%)
    module285 kB285 kB+301 B (+0.1%)
    react-native285 kB285 kB+301 B (+0.1%)
  • bundle

    TypeBase (510c9b5)Merge (ec2fa04)Diff
    firestore (Persistence)298 kB298 kB+301 B (+0.1%)
    firestore (Query Cursors)236 kB236 kB+281 B (+0.1%)
    firestore (Query)234 kB234 kB+281 B (+0.1%)
    firestore (Read data once)221 kB222 kB+281 B (+0.1%)
    firestore (Realtime updates)223 kB224 kB+281 B (+0.1%)
  • firebase

    TypeBase (510c9b5)Merge (ec2fa04)Diff
    firebase-compat.js771 kB772 kB+301 B (+0.0%)
    firebase-firestore-compat.js338 kB338 kB+301 B (+0.1%)
    firebase-firestore.js344 kB344 kB+301 B (+0.1%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 24, 2023

Size Analysis Report 1

This report is too large (283,134 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

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

@dconeybe
Copy link
Contributor Author

Note: The "Test Firestore" and "Test Firestore Integration" checks are failing and will be fixed by #7244.

The failing tests are:

  1. Aggregation queries allows backslash in aliases when using getAggregationFromServer
  2. Aggregation queries allows backticks in aliases when using getAggregationFromServer
  3. Aggregation queries allows special chars in aliases when using getAggregationFromServer
Chrome Headless 112.0.5615.121 (Linux x86_64) (Persistence=false) Aggregation queries allows special chars in aliases when using getAggregationFromServer FAILED
    AssertionError: expected undefined to equal 2
Chrome Headless 112.0.5615.121 (Linux x86_64) (Persistence=false) Aggregation queries allows backticks in aliases when using getAggregationFromServer FAILED
    AssertionError: expected undefined to equal 2
Chrome Headless 112.0.5615.121 (Linux x86_64) (Persistence=false) Aggregation queries allows backslash in aliases when using getAggregationFromServer FAILED
    AssertionError: expected undefined to equal 2

Copy link
Contributor

@tom-andersen tom-andersen left a comment

Choose a reason for hiding this comment

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

LGTM

@dconeybe dconeybe merged commit 18ace68 into master Apr 25, 2023
@dconeybe dconeybe deleted the dconeybe/TargetPurposeStringEnumValues branch April 25, 2023 18:31
dconeybe added a commit to firebase/firebase-ios-sdk that referenced this pull request Apr 26, 2023
@firebase firebase locked and limited conversation to collaborators Jun 1, 2023
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.

3 participants