Skip to content

Stop sending legacy raw stats in the SendStats payload - #1861

Open
aleksandar-apostolov wants to merge 3 commits into
developfrom
chore/and-1612-sunset-legacy-raw-stats
Open

aleksandar-apostolov wants to merge 3 commits into
developfrom
chore/and-1612-sunset-legacy-raw-stats

Conversation

@aleksandar-apostolov

@aleksandar-apostolov aleksandar-apostolov commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Closes AND-1612

GetStream/protocol#2116 removed the deprecated SendStatsRequest fields:
subscriber_stats (2), publisher_stats (3), audio_devices (7),
video_devices (8), subscriber_rtc_stats (13), publisher_rtc_stats (14).
This SDK still filled publisher_stats / subscriber_stats with a full raw
getStats() JSON dump on every stats tick, every reconnect and on leave. The
other four were never populated. JS equivalent: GetStream/stream-video-js#2488.

Implementation

  • signal.proto syncs with the protocol change — fields dropped, reserved 2, 3, 7, 8, 13, 14.
  • RtcSession.sendCallStats() loses its report: CallStatsReport? parameter.
    The collectStats() calls in sendConnectionTimeStats, prepareRejoin,
    CallReconnector.reconnectFast/migrate and CallLifecycleManager existed
    only to fill it and are gone with it; CallStatsReporter.start() keeps its
    call, which is what refreshes statsReport, statLatencyHistory and
    state.stats for local observers.
  • CallReconnector no longer takes CallStatsReporter, and Call.collectStats()
    is removed — both were left without callers.
  • CallStatsReport.toJson(StreamPeerType) is deprecated rather than removed so
    develop stays source-compatible. Removal belongs on develop-v2.
  • API dump regenerated: SendStatsRequest loses six getters and the wider
    constructor/copy overloads.

rtc_stats, encode_stats and decode_stats are unchanged.

Testing

./gradlew :stream-video-android-core:testDebugUnitTest --tests "*CallReconnectorTest*" --tests "*RtcSessionTest2*"
./gradlew compileDebugKotlin
./gradlew apiDump spotlessApply

33 tests, 0 failures. Not exercised against a live SFU — the payload shrinks,
and the backend already ignores the removed fields.

Summary by CodeRabbit

  • Changes
    • Call statistics reports no longer include separate publisher and subscriber details, raw RTC statistics, or audio and video device lists.
    • Connection and reconnection timing telemetry continues to be reported, and live statistics collection remains available for in-call monitoring.
    • The previous raw statistics serialization method is deprecated and is planned for removal in a future major version.

Syncs signal.proto with GetStream/protocol#2116, which removed the deprecated
SendStatsRequest fields. Android only populated publisher_stats and
subscriber_stats; sendCallStats() no longer takes a CallStatsReport and the
collectStats() calls that only existed to fill it are gone.
@aleksandar-apostolov aleksandar-apostolov added the pr:improvement Enhances an existing feature or code label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 12.38 MB 12.38 MB 0.00 MB 🟢
stream-video-android-ui-xml 5.66 MB 5.66 MB 0.00 MB 🟢
stream-video-android-ui-compose 6.19 MB 6.19 MB 0.00 MB 🟢

@aleksandar-apostolov
aleksandar-apostolov marked this pull request as ready for review October 7, 2026 13:00
@aleksandar-apostolov
aleksandar-apostolov requested a review from a team as a code owner October 7, 2026 13:00
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc2c4a1b-a734-4700-82e4-79a9a170e23b
📥 Commits

Reviewing files that changed from the base of the PR and between 622f636 and 4870658.

📒 Files selected for processing (10)
  • stream-video-android-core/api/stream-video-android-core.api
  • 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/CallStatsReport.kt
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/call/RtcSession.kt
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/call/components/CallLifecycleManager.kt
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/call/components/CallReconnector.kt
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/call/components/CallStatsReporter.kt
  • stream-video-android-core/src/main/proto/video/sfu/signal_rpc/signal.proto
  • stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/call/components/CallReconnectorTest.kt
  • stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/rtc/RtcSessionTest2.kt
💤 Files with no reviewable changes (2)
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt
  • stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/call/components/CallReconnectorTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Walkthrough

The PR removes per-peer stats and input-device fields from SendStatsRequest. Call-stat reporting no longer collects or sends CallStatsReport data, while separate stats collection and connection-time telemetry remain.

Changes

SendStats payload and reporting

Layer / File(s) Summary
SendStatsRequest contract
stream-video-android-core/src/main/proto/video/sfu/signal_rpc/signal.proto, stream-video-android-core/api/stream-video-android-core.api
SendStatsRequest removes the listed per-peer stats and input-device fields and reserves their field numbers. Its API signature reflects the reduced field set.
Call-stat reporting paths
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/..., stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/...
Call-stat submission no longer collects or sends CallStatsReport data. Stats collection remains separate, and connection-time telemetry remains. Reconnector wiring and tests use the updated call signature. CallStatsReport.toJson is deprecated.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: pratimmallick

Merge Risk: ⚪ Minimal · up to 48706

The payload reduction appears consistent across the schema, generated API, and reporting paths. No concrete merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 6 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 and concisely describes the main change: removing legacy raw stats from the SendStats payload.
Description check ✅ Passed The description covers the goal, implementation, and testing, and links the issue. The UI and visual-material sections do not apply to this non-UI change. The description is mostly complete.
Full details: Docstring Coverage

Explanation

Docstring coverage is 18.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 6 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the stats payload,
The old peer fields hop away.
Device fields leave the message too,
While session numbers stay in view.
The reporter gathers stats apart,
Then sends the lean request to start.

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

@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

This branch has not been deployed

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

Labels

pr:improvement Enhances an existing feature or code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants