Skip to content

feat(transport): send WorkOS Android/<version> User-Agent header - #5

Merged
gjtorikian merged 1 commit into
mainfrom
feat/user-agent-header
Aug 17, 2026
Merged

gjtorikian merged 1 commit into
mainfrom
feat/user-agent-header

Conversation

@gjtorikian

Copy link
Copy Markdown
Collaborator

Summary

  • Requests previously went out with OkHttp's default User-Agent (okhttp/4.12.0), leaving Android SDK traffic unattributable in the data platform's fct_log_events_sdk model.
  • Transport now sets User-Agent: WorkOS Android/<version> on every request, mirroring the WorkOS iOS/<version> shape with an end-anchored version so the existing regex convention applies unchanged. Per-request RequestOptions headers can still override it.
  • The version const in Transport.kt carries the x-release-please-version marker and is registered in release-please-config.json extra-files, so release-please stamps it in lockstep with build.gradle.kts — no manual updates.
  • Adds a behavior test asserting the header matches WorkOS Android/[^\s]+.

Note: fct_log_events_sdk.sql in workos/data-platform still needs a "WorkOS Android" entry in its sdks map before attribution shows up there.

Requests previously went out with OkHttp's default UA (okhttp/4.12.0),
making Android SDK traffic unattributable in fct_log_events_sdk. The
header mirrors the WorkOS iOS/<version> shape with an end-anchored
version so the data platform's regex convention applies unchanged.

The version const is stamped by release-please via a new extra-files
entry, keeping it in lockstep with build.gradle.kts.
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Greptile Summary

The PR identifies Android SDK traffic by adding a versioned User-Agent header and configures release-please to keep that version synchronized with releases.

  • Adds User-Agent: WorkOS Android/<version> to every transport request while preserving per-request header overrides.
  • Registers the transport version constant as a release-please generic extra file.
  • Adds a behavior test covering the emitted User-Agent format.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The fixed User-Agent is applied to all transport requests, remains overridable through existing request headers, and uses a release-please marker compatible with the repository’s release configuration.

Important Files Changed

Filename Overview
release-please-config.json Registers the Kotlin transport file for generic release-version stamping using its inline marker.
src/main/kotlin/com/workos/android/internal/Transport.kt Adds a release-stamped SDK version constant and sends the corresponding default User-Agent before applying request-level overrides.
src/test/kotlin/com/workos/android/TransportBehaviorTest.kt Verifies that requests include an end-anchored WorkOS Android User-Agent with a nonblank version.

Reviews (1): Last reviewed commit: "feat(transport): send a WorkOS Android/<..." | Re-trigger Greptile

@gjtorikian
gjtorikian merged commit 8588113 into main Aug 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant