Skip to content

Add hint_high_scale_livestream_publisher to the coordinator JoinCallRequest#1654

Merged
aleksandar-apostolov merged 3 commits intodevelopfrom
feat/hint-high-scale-livestream-publisher
Apr 23, 2026
Merged

Add hint_high_scale_livestream_publisher to the coordinator JoinCallRequest#1654
aleksandar-apostolov merged 3 commits intodevelopfrom
feat/hint-high-scale-livestream-publisher

Conversation

@aleksandar-apostolov
Copy link
Copy Markdown
Contributor

@aleksandar-apostolov aleksandar-apostolov commented Apr 22, 2026

Goal

Allow callers to hint that the participant is publishing to a large audience when joining a call.

Mirrors GetStream/stream-video-js#2199.

Implementation

Added optional hintHighScaleLivestreamPublisher: Boolean? parameter threaded through:

Call.join()Call._join()Call.joinRequest()StreamVideoClient.joinCall()JoinCallRequest

Field is nullable with null default — fully backward compatible.

Testing

  • Debug compilation passes
  • Note: release compilation has a pre-existing RequiresApi import issue in MediaManager.kt (unrelated to this change)

Summary by CodeRabbit

  • New Features
    • Added optional hintHighScaleLivestreamPublisher parameter to call joining methods, enabling developers to indicate high-scale livestream publishing scenarios when joining calls. This parameter is now threaded through the entire join flow and forwarded to the API request for enhanced call configuration.

Add optional hintHighScaleLivestreamPublisher param to the join flow,
allowing callers to hint that the participant is publishing to a large
audience. Threaded through Call.join() → Call.joinRequest() →
StreamVideoClient.joinCall() → JoinCallRequest.

Mirrors GetStream/stream-video-js#2199.
@aleksandar-apostolov aleksandar-apostolov requested a review from a team as a code owner April 22, 2026 13:32
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Walkthrough

Added optional hintHighScaleLivestreamPublisher parameter to Call join methods and StreamVideoClient.joinCall, threading it through the join flow to the JoinCallRequest for high-scale livestream publisher hint propagation.

Changes

Cohort / File(s) Summary
Call Join Methods
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt
Added optional hintHighScaleLivestreamPublisher: Boolean? = null parameter to join(), _join(), and joinRequest() methods, threading it through the retry loop and reconnection flows to the join request.
StreamVideoClient Join Method
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt
Added optional hintHighScaleLivestreamPublisher: Boolean? = null parameter to joinCall() and forwarded it into the constructed JoinCallRequest object.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hint passed through the call so grand,
From client down to join's command,
High-scale livestreams now know the way,
With optional whispers here to stay!
Thread it through, keep backward sound, 🎬✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description covers Goal, Implementation, and Testing sections. However, several template sections are missing: UI Changes, detailed Testing with patch, Contributor Checklist, and Reviewer Checklist.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding a hint parameter for high-scale livestream publishers to the JoinCallRequest. It accurately reflects the primary objective of the pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/hint-high-scale-livestream-publisher

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt (1)

829-900: ⚠️ Potential issue | 🟠 Major

Carry the hint into rejoin and migration requests.

Line 829 and Line 900 call joinRequest without the original hint, so a high-scale publisher rejoins/migrates with hintHighScaleLivestreamPublisher = null. Persist the join-time value and pass it on later join requests.

Proposed fix
     private var sfuSocketReconnectionTime: Long? = null
+    private var highScaleLivestreamPublisherHint: Boolean? = null
     suspend fun join(
         create: Boolean = false,
         createOptions: CreateCallOptions? = null,
         ring: Boolean = false,
         notify: Boolean = false,
         hintHighScaleLivestreamPublisher: Boolean? = null,
     ): Result<RtcSession> {
+        highScaleLivestreamPublisherHint = hintHighScaleLivestreamPublisher
         logger.d {
-            val joinResponse = joinRequest(location = it)
+            val joinResponse = joinRequest(
+                location = it,
+                hintHighScaleLivestreamPublisher = highScaleLivestreamPublisherHint,
+            )
-            val joinResponse = joinRequest(location = it, migratingFrom = session.value?.sfuName)
+            val joinResponse = joinRequest(
+                location = it,
+                migratingFrom = session.value?.sfuName,
+                hintHighScaleLivestreamPublisher = highScaleLivestreamPublisherHint,
+            )

Also applies to: 1543-1568

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt`
around lines 829 - 900, The rejoin and migrate flows call joinRequest without
propagating the original hintHighScaleLivestreamPublisher, causing later
joinRequest calls (in functions using joinRequest such as the rejoin schedule
block and migrate schedule block) to send null; persist the original hint when
the initial join succeeds (store it on the Call instance, e.g., a property like
persistedHint or initialHint) and update the two call sites (the rejoin block
that builds reconnectDetails and the migrate block that calls joinRequest) to
pass that persisted hint into joinRequest's hintHighScaleLivestreamPublisher
parameter so subsequent joinRequest calls include the original high-scale
publisher hint.
🧹 Nitpick comments (1)
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt (1)

510-516: Document the new public join hint.

Line 515 adds an advanced public API flag with nullable semantics; please add KDoc explaining when to set it and what null means.

Suggested KDoc
+    /**
+     * Joins this call and establishes an RTC session.
+     *
+     * `@param` hintHighScaleLivestreamPublisher Set to `true` when this participant is expected
+     * to publish to a large audience so backend routing can optimize for high-scale livestreams.
+     * Leave `null` to use the backend default behavior.
+     */
     suspend fun join(

As per coding guidelines, Use KDoc (/** ... */) for public APIs and complex subsystems; link to Stream docs when relevant.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt`
around lines 510 - 516, Add KDoc for the public suspend fun join(...) parameter
hintHighScaleLivestreamPublisher (and update the function KDoc) describing what
the flag does, when callers should pass true/false, and that null means “use
server/default behavior” or “unspecified” (exact wording per product behavior);
place the KDoc above the join function using /** ... */ and include a brief
sentence linking to the Stream docs or relevant feature doc for more details;
reference the parameter name hintHighScaleLivestreamPublisher and the function
name join in the comment so readers can find it easily.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt`:
- Around line 829-900: The rejoin and migrate flows call joinRequest without
propagating the original hintHighScaleLivestreamPublisher, causing later
joinRequest calls (in functions using joinRequest such as the rejoin schedule
block and migrate schedule block) to send null; persist the original hint when
the initial join succeeds (store it on the Call instance, e.g., a property like
persistedHint or initialHint) and update the two call sites (the rejoin block
that builds reconnectDetails and the migrate block that calls joinRequest) to
pass that persisted hint into joinRequest's hintHighScaleLivestreamPublisher
parameter so subsequent joinRequest calls include the original high-scale
publisher hint.

---

Nitpick comments:
In
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt`:
- Around line 510-516: Add KDoc for the public suspend fun join(...) parameter
hintHighScaleLivestreamPublisher (and update the function KDoc) describing what
the flag does, when callers should pass true/false, and that null means “use
server/default behavior” or “unspecified” (exact wording per product behavior);
place the KDoc above the join function using /** ... */ and include a brief
sentence linking to the Stream docs or relevant feature doc for more details;
reference the parameter name hintHighScaleLivestreamPublisher and the function
name join in the comment so readers can find it easily.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 11295819-6c01-4ce6-b885-669a2561a6eb

📥 Commits

Reviewing files that changed from the base of the PR and between 7c10e38 and 24faa68.

⛔ Files ignored due to path filters (1)
  • stream-video-android-core/src/main/kotlin/io/getstream/android/video/generated/models/JoinCallRequest.kt is excluded by !**/generated/**
📒 Files selected for processing (2)
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt

@aleksandar-apostolov aleksandar-apostolov changed the title feat: add hint_high_scale_livestream_publisher to JoinCallRequest Add hint_high_scale_livestream_publisher to JoinCallRequest Apr 22, 2026
@aleksandar-apostolov aleksandar-apostolov added the pr:new-feature Adds new functionality label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 12.02 MB 12.02 MB 0.00 MB 🟢
stream-video-android-ui-xml 5.68 MB 5.68 MB 0.00 MB 🟢
stream-video-android-ui-compose 6.28 MB 6.28 MB 0.00 MB 🟢

@aleksandar-apostolov aleksandar-apostolov changed the title Add hint_high_scale_livestream_publisher to JoinCallRequest Add hint_high_scale_livestream_publisher to the coordinator JoinCallRequest Apr 23, 2026
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor

@rahul-lohra rahul-lohra left a comment

Choose a reason for hiding this comment

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

tested & LGTM

@aleksandar-apostolov aleksandar-apostolov merged commit 37c7bdf into develop Apr 23, 2026
12 of 13 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the feat/hint-high-scale-livestream-publisher branch April 23, 2026 09:33
@stream-public-bot stream-public-bot added the released Included in a release label Apr 23, 2026
@stream-public-bot
Copy link
Copy Markdown
Collaborator

🚀 Available in v1.22.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new-feature Adds new functionality released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants