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

Add x-goog-request-params to request header. #7440

Merged
merged 22 commits into from
Jul 17, 2023

Conversation

tom-andersen
Copy link
Contributor

@tom-andersen tom-andersen commented Jul 11, 2023

Fix named databases calls to backend with REST connection that experience error:

Missing routing header. Please fill in the request header with format x-goog-request-params:project_id=mrenshaw-multi-db&database_id=my-database

@tom-andersen tom-andersen requested review from a team as code owners July 11, 2023 14:32
@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2023

🦋 Changeset detected

Latest commit: a61a8e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 11, 2023

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (fa160f7)Merge (9617f55)Diff
    browser370 kB371 kB+206 B (+0.1%)
    esm5356 kB356 kB+242 B (+0.1%)
    main569 kB569 kB+1 B (+0.0%)
    module370 kB371 kB+206 B (+0.1%)
    react-native371 kB371 kB+206 B (+0.1%)
  • @firebase/firestore-lite

    TypeBase (fa160f7)Merge (9617f55)Diff
    browser110 kB110 kB+205 B (+0.2%)
    esm5106 kB107 kB+241 B (+0.2%)
    main151 kB151 kB+319 B (+0.2%)
    module110 kB110 kB+205 B (+0.2%)
    react-native110 kB110 kB+205 B (+0.2%)
  • bundle

    12 size changes

    TypeBase (fa160f7)Merge (9617f55)Diff
    firestore (Persistence)301 kB301 kB+206 B (+0.1%)
    firestore (Query Cursors)239 kB239 kB+206 B (+0.1%)
    firestore (Query)236 kB236 kB+206 B (+0.1%)
    firestore (Read data once)224 kB224 kB+206 B (+0.1%)
    firestore (Realtime updates)226 kB226 kB+206 B (+0.1%)
    firestore (Transaction)202 kB203 kB+206 B (+0.1%)
    firestore (Write data)202 kB203 kB+206 B (+0.1%)
    firestore-lite (Query Cursors)82.9 kB83.1 kB+203 B (+0.2%)
    firestore-lite (Query)79.0 kB79.2 kB+203 B (+0.3%)
    firestore-lite (Read data once)61.1 kB61.3 kB+203 B (+0.3%)
    firestore-lite (Transaction)85.9 kB86.1 kB+203 B (+0.2%)
    firestore-lite (Write data)70.6 kB70.8 kB+203 B (+0.3%)

  • firebase

    TypeBase (fa160f7)Merge (9617f55)Diff
    firebase-compat.js774 kB774 kB+206 B (+0.0%)
    firebase-firestore-compat.js340 kB340 kB+206 B (+0.1%)
    firebase-firestore-lite.js117 kB118 kB+205 B (+0.2%)
    firebase-firestore.js430 kB430 kB+206 B (+0.0%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 11, 2023

Size Analysis Report 1

Affected Products

  • @firebase/firestore

    • addDoc

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size122 kB122 kB+206 B (+0.2%)
      size-with-ext-deps192 kB192 kB+206 B (+0.1%)
    • deleteDoc

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size113 kB113 kB+206 B (+0.2%)
      size-with-ext-deps183 kB183 kB+206 B (+0.1%)
    • disableNetwork

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size101 kB101 kB+206 B (+0.2%)
      size-with-ext-deps171 kB172 kB+206 B (+0.1%)
    • enableIndexedDbPersistence

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size183 kB184 kB+206 B (+0.1%)
      size-with-ext-deps255 kB255 kB+206 B (+0.1%)
    • enableMultiTabIndexedDbPersistence

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size220 kB221 kB+206 B (+0.1%)
      size-with-ext-deps292 kB292 kB+206 B (+0.1%)
    • enableNetwork

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size101 kB101 kB+206 B (+0.2%)
      size-with-ext-deps171 kB172 kB+206 B (+0.1%)
    • executeWrite

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size112 kB112 kB+206 B (+0.2%)
      size-with-ext-deps182 kB182 kB+206 B (+0.1%)
    • getAggregateFromServer

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size108 kB108 kB+206 B (+0.2%)
      size-with-ext-deps178 kB179 kB+206 B (+0.1%)
    • getCountFromServer

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size108 kB109 kB+206 B (+0.2%)
      size-with-ext-deps179 kB179 kB+206 B (+0.1%)
    • getDoc

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size143 kB143 kB+206 B (+0.1%)
      size-with-ext-deps213 kB213 kB+206 B (+0.1%)
    • getDocFromServer

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size143 kB143 kB+206 B (+0.1%)
      size-with-ext-deps213 kB213 kB+206 B (+0.1%)
    • getDocs

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size145 kB145 kB+206 B (+0.1%)
      size-with-ext-deps215 kB215 kB+206 B (+0.1%)
    • getDocsFromServer

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size144 kB145 kB+206 B (+0.1%)
      size-with-ext-deps215 kB215 kB+206 B (+0.1%)
    • loadBundle

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size111 kB111 kB+206 B (+0.2%)
      size-with-ext-deps181 kB181 kB+206 B (+0.1%)
    • memoryLocalCache

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size98.2 kB98.5 kB+206 B (+0.2%)
      size-with-ext-deps168 kB169 kB+206 B (+0.1%)
    • onSnapshot

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size145 kB145 kB+206 B (+0.1%)
      size-with-ext-deps215 kB216 kB+206 B (+0.1%)
    • onSnapshotsInSync

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size135 kB135 kB+206 B (+0.2%)
      size-with-ext-deps205 kB205 kB+206 B (+0.1%)
    • persistentLocalCache

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size181 kB181 kB+206 B (+0.1%)
      size-with-ext-deps252 kB253 kB+206 B (+0.1%)
    • persistentMultipleTabManager

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size217 kB217 kB+206 B (+0.1%)
      size-with-ext-deps289 kB289 kB+206 B (+0.1%)
    • persistentSingleTabManager

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size180 kB181 kB+206 B (+0.1%)
      size-with-ext-deps252 kB252 kB+206 B (+0.1%)
    • runTransaction

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size122 kB122 kB+206 B (+0.2%)
      size-with-ext-deps192 kB192 kB+206 B (+0.1%)
    • setDoc

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size121 kB121 kB+206 B (+0.2%)
      size-with-ext-deps191 kB192 kB+206 B (+0.1%)
    • updateDoc

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size122 kB122 kB+206 B (+0.2%)
      size-with-ext-deps192 kB192 kB+206 B (+0.1%)
    • waitForPendingWrites

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size102 kB102 kB+206 B (+0.2%)
      size-with-ext-deps172 kB172 kB+206 B (+0.1%)
    • writeBatch

      Size

      TypeBase (fa160f7)Merge (9617f55)Diff
      size124 kB124 kB+206 B (+0.2%)
      size-with-ext-deps194 kB194 kB+206 B (+0.1%)

Test Logs

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

Copy link
Contributor

@MarkDuckworth MarkDuckworth left a comment

Choose a reason for hiding this comment

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

I think the fix looks good. I've not been able to determine if the latest emulator supports this x-goog-request-params format. If not, then we may have to tweak this PR further.

"@firebase/firestore": patch
---

Add `x-goog-request-params` to REST request header.
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about release notes stating what is fixed in terms of what the customer understands?

For example this could be "Fixed issue where count and lite API queries did not work with named databases."

Copy link
Contributor Author

@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.

I need to clarify proper header format with Firestore team. The failing CI is due to a different format being expected by emulator.

@tom-andersen
Copy link
Contributor Author

@hsubox76 Ready for review.

@tom-andersen tom-andersen merged commit c5518c8 into master Jul 17, 2023
27 checks passed
@tom-andersen tom-andersen deleted the tomandersen/x-goog-request-params branch July 17, 2023 21:55
@google-oss-bot google-oss-bot mentioned this pull request Jul 18, 2023
@firebase firebase locked and limited conversation to collaborators Aug 17, 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.

None yet

5 participants