Repository navigation
fix: Send the Flagsmith-SDK-User-Agent header so Flagsmith can tell which SDK sent each request - #99
Merged
Merged
Conversation
…hich SDK sent each request Flagsmith's events ingestion server reads the SDK language and version only from the Flagsmith-SDK-User-Agent header. Send it from the shared user agent interceptor, with the same value as User-Agent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
talissoncosta
approved these changes
Nov 10, 2026
Zaimwa9
pushed a commit
that referenced
this pull request
Nov 10, 2026
🤖 I have created a release *beep* *boop* --- ## [1.10.0](v1.9.0...v1.10.0) (2026-11-10) ### Features * Support `getExperimentFlag`, `trackEvent` and `trackExposure` methods ([#98](#98)) ([6989568](6989568)) ### Bug Fixes * Send the Flagsmith-SDK-User-Agent header so Flagsmith can tell which SDK sent each request ([#99](#99)) ([0c50799](0c50799)) * Send trait values with their JSON types ([#90](#90)) ([644d69f](644d69f)) ### CI * Run the Flagsmith SDK behavioural spec ([#89](#89)) ([169807e](169807e)) ### Other * Give Renovate's pull requests Conventional Commit titles ([#94](#94)) ([1e5a09e](1e5a09e)) * Let Renovate keep updating spec bumps the webhook handler commits to ([#95](#95)) ([07f9181](07f9181)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Flagsmith's events ingestion server reads the SDK language and version only from the
Flagsmith-SDK-User-Agentheader, parsingflagsmith-<lang>-sdk/<version>. It ignoresUser-Agent. The Kotlin SDK only sendsUser-Agent, so its events would be stored withsdk_languageandsdk_versionset tounknown.What changed
FlagsmithRetrofitService.userAgentInterceptor()now also setsFlagsmith-SDK-User-Agentto the same value asUser-Agent(flagsmith-kotlin-android-sdk/<version>).User-Agentis unchanged. The header name is a named constant, likeUSER_AGENT_HEADER.The header goes on every request the interceptor handles, not only events:
User-Agentfor the rest.Flagsmith-SDK-User-Agentfirst and falls back toUser-Agentwhen it labels SDK usage. Both headers carry the same value here, so API labelling does not change.Adding it in the shared interceptor keeps the change to one place and means any client built on that interceptor sends it.
PR #98 adds
FlagsmithEventProcessor, whose OkHttp client reusesuserAgentInterceptor(). Once #98 is rebased on this, its event requests send the header with no further change.How it was tested
UserAgentTests.testFlagsmithSdkUserAgentHeaderIsSentmakes a real flags request against MockServer and checks the recordedFlagsmith-SDK-User-Agentvalue. The version line sits inside the release-please markers like the existing test, so release bumps keep it in sync../gradlew check -x koverVerify -P excludeIntegrationTestspasses locally.