Skip to content

fix(llc): report correct X-Stream-Client header values - #125

Merged
VelikovPetar merged 1 commit into
mainfrom
petarvelikov/flu-734-fix-the-x-stream-client-header-values-reported-by-the-feeds
Aug 26, 2026
Merged

fix(llc): report correct X-Stream-Client header values#125
VelikovPetar merged 1 commit into
mainfrom
petarvelikov/flu-734-fix-the-x-stream-client-header-values-reported-by-the-feeds

Conversation

@VelikovPetar

Copy link
Copy Markdown
Contributor

Submit a pull request

Closes FLU-734
Closes #

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

The SDK was sending X-Stream-Client: stream-feeds-dart-dart-v0.3.0. Three defects, all in the environment baseline in feeds_client_impl.dart, which still carried a // TODO: Fill this with correct values:

Before After
Duplicated identifier — sdkName already carried dart, and the format is {sdkName}-{sdkIdentifier}-v{sdkVersion} stream-feeds-dart-dart- stream-feeds-dart-
Hardcoded version, two releases stale v0.3.0 v0.5.1, derived from pubspec.yaml
osName never set, so no os= segment at all (absent) os=android

Why it matters

These fields are how Stream attributes API traffic to an SDK and version. Feeds traffic was being attributed to a client string matching no real release, so a report of "Feeds Flutter 0.3.0" couldn't be correlated with anything — bad for usage analytics and for support triage.

It's also a prerequisite for FLU-727, which locks sdkName, sdkVersion and osName to whatever the SDK passes at construction. The baseline has to be right first, or that guard would permanently pin os= off and freeze the stale version.

Changes

  • sdkNamestream-feeds, matching the other Feeds SDKs. sdkName/sdkIdentifier extracted as constants.
  • sdkVersion → a generated packageVersion constant. tools/generate_version.dart derives it from pubspec.yaml and runs on every melos bootstrap via command.bootstrap.hooks.post, so it can't drift again. Same approach as the Chat and Video SDKs; kept deliberately close to Chat's script, minus its sample_app version bump (Chat and Video already differ there, and Feeds' release checklist doesn't cover it).
  • osNameCurrentPlatform.operatingSystem, so the platform is detected at runtime.
  • Fixed the updateSystemEnvironment dartdoc — its example passed name:/version:, parameters that never existed on SystemEnvironment, so the snippet didn't compile.
  • AGENTS.md notes that lib/src/version.dart is generated and must not be hand-edited.

lib/src/version.dart sits under src/ rather than lib/ (where Chat puts it) because Feeds' lib/ root holds exactly one public library, and nothing outside the package consumes the constant.

Testing

  • Full suite passes (404), dart analyze --fatal-infos and dart format clean.
  • Generator verified end-to-end: deliberately drifted the constant to 9.9.9 and confirmed melos bootstrap regenerated it to 0.5.1; re-running is a no-op.
  • Verified on an Android emulator, reading the SDK's own request logging rather than trusting a unit test:
    X-Stream-Client: stream-feeds-dart-v0.5.1|os=android
    
    Identical across all 13 requests in the buffer, with zero occurrences of stream-feeds-dart-dart or v0.3.0. os=android rather than the host's macos confirms runtime platform detection.

No app=/app_version=/device_model= segments appear, which is expected — those only populate when a consuming app calls updateSystemEnvironment.

Screenshots / Videos

N/A — no UI surface.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 127421c5-75be-49ee-a862-0c1abfad5e1f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.57%. Comparing base (9bc5fab) to head (1f1f1f7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #125   +/-   ##
=======================================
  Coverage   85.56%   85.57%           
=======================================
  Files         124      124           
  Lines        4364     4366    +2     
=======================================
+ Hits         3734     3736    +2     
  Misses        630      630           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VelikovPetar
VelikovPetar force-pushed the petarvelikov/flu-734-fix-the-x-stream-client-header-values-reported-by-the-feeds branch from 3f4074d to 1f1f1f7 Compare August 25, 2026 15:15
@VelikovPetar
VelikovPetar marked this pull request as ready for review August 25, 2026 19:02
@VelikovPetar
VelikovPetar requested a review from a team as a code owner August 25, 2026 19:02
@VelikovPetar
VelikovPetar merged commit 6c1920e into main Aug 26, 2026
13 checks passed
@VelikovPetar
VelikovPetar deleted the petarvelikov/flu-734-fix-the-x-stream-client-header-values-reported-by-the-feeds branch August 26, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants