Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(llc, core, ui): update X-Stream-Client header for enhanced client identification #2131

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

xsahil03x
Copy link
Member

@xsahil03x xsahil03x commented Mar 6, 2025

Resolves: FLU-31

Description of the pull request

Aligned the X-Stream-Client header with the other SDK's based on the notion doc.

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 66.15385% with 22 lines in your changes missing coverage. Please review.

Project coverage is 60.47%. Comparing base (5bb5944) to head (e3d8e4a).

Files with missing lines Patch % Lines
...am_chat_flutter_core/lib/src/stream_chat_core.dart 44.82% 16 Missing ⚠️
packages/stream_chat/lib/src/client/client.dart 33.33% 4 Missing ⚠️
.../src/core/platform_detector/platform_detector.dart 87.50% 1 Missing ⚠️
packages/stream_chat/lib/src/ws/websocket.dart 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2131      +/-   ##
==========================================
- Coverage   60.49%   60.47%   -0.02%     
==========================================
  Files         382      384       +2     
  Lines       23782    23827      +45     
==========================================
+ Hits        14386    14410      +24     
- Misses       9396     9417      +21     

☔ View full report in Codecov by Sentry.
📢 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.

Comment on lines +11 to +17
SystemEnvironmentManager({
SystemEnvironment environment = const SystemEnvironment(
sdkName: 'stream-chat',
sdkIdentifier: 'dart',
sdkVersion: PACKAGE_VERSION,
),
}) : _environment = environment;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to have people change these values. What do you think of creating 2 constructors like this? (simplified)

Suggested change
SystemEnvironmentManager({
SystemEnvironment environment = const SystemEnvironment(
sdkName: 'stream-chat',
sdkIdentifier: 'dart',
sdkVersion: PACKAGE_VERSION,
),
}) : _environment = environment;
SystemEnvironmentManager.llc() : sdkIdentifier = 'dart';
SystemEnvironmentManager.core() : sdkIdentifier = 'core';
SystemEnvironmentManager.flutter() : sdkIdentifier = 'flutter';

For Core and Flutter I would add an AppConfig parameter, which only contains the app specific settings, such as appName and appVersion. We can make more variables required there.

String? deviceModel;

try {
switch (CurrentPlatform.type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following my other comment, I would move this to an AppConfig class which can be used both by core and flutter.

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