feat(data-connect): add "X-Client-Platform" and "X-Client-Version" headers - #10217
feat(data-connect): add "X-Client-Platform" and "X-Client-Version" headers#10217dconeybe wants to merge 17 commits into
Conversation
…aders Googlers see go/dataconnect:sdk:headers for details
🦋 Changeset detectedLatest commit: 720b031 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
There was a problem hiding this comment.
Code Review
This pull request adds 'x-client-platform' and 'x-client-version' headers to both REST and stream transport requests in the @firebase/data-connect package to enable metrics collection. These headers are included in the initial stream message and standard fetch requests, and corresponding unit tests have been added to verify this behavior. There are no review comments, and I have no additional feedback to provide.
…ctions failures" This reverts commit 10add5e.
…ase, to see if it fixes CORS errors
…ersion" headers to see if the github actions still fail.
… logs with the tests in question
…Client-Version" headers to see if the github actions still fail." This reverts commit 37e8a4e.
…-Client-Version" headers to see if the github actions still fail." This reverts commit aac56b0.
|
Turns out that the tests were failing because the dataconnect backend servers reject the Therefore, CORS preflight requests that contain both Googlers can see go/api-cors for where the whitelist is maintained |
|
After discussion, the decision was made to mash Here are some example values:
I will update this PR accordingly. |
This PR adds
x-client-platformandx-client-versionrequest headers to the@firebase/data-connectSDK. These headers send the client platform (web) and SDK version to enable metrics collection in Cloud Monitoring.Highlights
x-client-platform(set to"web") andx-client-version(set toSDK_VERSION) request headers across REST (fetch.ts) and streaming (streamTransport.ts) transports.x-client-platformandx-client-versionexclusively on the initial stream message.userAgent.test.tsandstreamTransport.test.tsverifying header inclusion on REST calls and initial streaming messages, as well as omission on subsequent streaming messages.@firebase/data-connect.Changelog
x-client-platformandx-client-versionheaders todcFetch.x-client-platformandx-client-versionheaders insideprepareMessagefor the initial stream message.x-client-platformandx-client-versionfields toStreamRequestHeaders.x-client-platformandx-client-versionare present on the first stream message only.x-client-platformandx-client-version.