fix(in-app): send app identifier header to gist - #812
Merged
Merged
Conversation
Gist needs to know which app a request came from so the backend can filter messages by platform and app. Send the host app's package name as X-CIO-App-Identifier alongside the existing platform header, from the shared header builder so both the queue fetch and the SSE connect carry it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #812 +/- ##
============================================
- Coverage 69.07% 66.43% -2.64%
- Complexity 838 1539 +701
============================================
Files 149 245 +96
Lines 4601 8765 +4164
Branches 628 1443 +815
============================================
+ Hits 3178 5823 +2645
- Misses 1189 2482 +1293
- Partials 234 460 +226 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Build available to test |
📏 SDK Binary Size Comparison Report
|
…ifier Aligns with the X-CIO-Client-* naming the other client headers use. The test now spells the wire name out instead of reading the constant, so a rename of the constant's value cannot slip through. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mahmoud-elmorabea
approved these changes
Aug 13, 2026
cio-mobile-release Bot
pushed a commit
that referenced
this pull request
Aug 21, 2026
## [4.20.2](4.20.1...4.20.2) (2026-08-21) ### Bug Fixes * **in-app:** send app identifier header to gist ([#812](#812)) ([bbd5616](bbd5616))
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.
https://linear.app/customerio/issue/INAPP-14655/mobile-add-app-identifier-header-for-app-filtering
Summary
Gist needs to know which app a request came from so the backend can filter messages by platform and app. The SDK now sends the host app's package name as
X-CIO-Client-App-Identifieralongside the platform header it already sends.The header is added in
NetworkUtilities.addCommonHeaders, whose only two callers are the queue fetch client (Queue.createHttpClient) and the SSE connect interceptor (SseService.createSseHttpClient) — so one header set rides fetch and SSE alike. No query-parameter variant is needed on mobile: native SSE clients set headers, and only gist-web passesplatform=webas a query param because browserEventSourcecannot.Changes
X-CIO-Client-App-Identifier: <package name>on every gist request, sourced fromapplicationStore.customerPackageName.SDKComponent.android()lookup into a local and grouped the client/app headers together.Wrappers
React Native, Expo and Flutter all initialize the native SDK with the host
Application(reactContext.applicationContext/ the plugin'sapplication), so the header carries the host app'sapplicationId, not a wrapper id. The platform header still reports the wrapper (e.g.reactnative-android). A test locks this in by overriding the SDK source and asserting the app identifier is unchanged.Note for backend registration: on Android this value is the Gradle
applicationId, so it picks up per-variant suffixes (e.g.applicationIdSuffix ".debug").Test plan
New
NetworkUtilitiesTestcovers the fetch variant, the SSE variant (includeUserToken = false), and the wrapper-source case.:messaginginapp:runJacocoTestReport— 522 tests, 0 failures. ktlint andapiCheckclean (the constant isinternal, so no public API change).Verified on a Pixel 10 Pro emulator (API 36,
kotlin_composesample) with a temporary header probe, since the SDK has no request logging. Both requests carried the header:The sample workspace does not return
X-CIO-Use-SSE: true, so the SSE flag was forced locally to make the connect fire. Both the probe and the forced flag were reverted before committing.🤖 Generated with Claude Code
Note
Low Risk
Additive, internal header on existing Gist clients with unit coverage; no changes to auth, tokens, or public API.
Overview
Gist in-app traffic now includes
X-CIO-Client-App-Identifieron every request that usesNetworkUtilities.addCommonHeaders(queue fetch and SSE connect). The value is the host app’sapplicationStore.customerPackageName(GradleapplicationId), so backend filtering can distinguish apps while the existing platform header still reflects wrapper sources likereactnative-android.addCommonHeadersalso hoists a singleSDKComponent.android()lookup and groups the client metadata headers together.NetworkUtilitiesTestasserts the wire header name and value for fetch, SSE (includeUserToken = false), and a React Native–style client override where the app id stays the host package.Reviewed by Cursor Bugbot for commit 6fb0e9d. Bugbot is set up for automated code reviews on this repo. Configure here.