Skip to content

Conversation

@aleksandar-apostolov
Copy link
Collaborator

@aleksandar-apostolov aleksandar-apostolov commented Nov 27, 2025

Goal

Easier instance creation of the client.

Implementation

In the StreamClient factory method, we've now added sensible defaults to everything that is not mandatory to configure by the product.

Testing

Build core locally and check if you can remove the big chunk of creation logic there is in feeds. :)

Checklist

  • Issue linked (if any)
  • Tests/docs updated
  • I have signed the Stream CLA (required for external contributors)

@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

Copilot finished reviewing on behalf of aleksandar-apostolov November 27, 2025 15:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the StreamClient factory method by adding default parameter values for all non-mandatory configuration options, significantly reducing boilerplate code required to instantiate the client. The changes demonstrate the improvement by replacing the verbose createStreamClient helper function with direct client instantiation using the enhanced factory method.

  • Added default parameter values to the StreamClient factory method for subscription managers, processors, monitors, and other components
  • Moved client instantiation to the Application class (SampleApp) for proper lifecycle management
  • Removed the now-unnecessary createStreamClient helper function

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
stream-android-core/src/main/java/io/getstream/android/core/api/StreamClient.kt Added default parameter values for components that don't require explicit configuration, reorganized parameters with mandatory ones first
app/src/main/java/io/getstream/android/core/sample/client/StreamClient.kt Removed the entire createStreamClient helper function (158 lines) as it's no longer needed
app/src/main/java/io/getstream/android/core/sample/SampleApp.kt New Application class that creates and holds the StreamClient instance using the simplified factory method
app/src/main/java/io/getstream/android/core/sample/SampleActivity.kt Updated to retrieve StreamClient from SampleApp instead of creating it locally, added onDestroy cleanup
app/src/main/AndroidManifest.xml Registered SampleApp as the application class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aleksandar-apostolov aleksandar-apostolov merged commit f6ff2c1 into develop Nov 27, 2025
11 of 12 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the default-constructor branch November 27, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants