Skip to content

Start ring state polling after 9s instead of 15s - #1859

Merged
PratimMallick merged 1 commit into
developfrom
chore/and-1607-ring-poll-start-after-9s
Oct 7, 2026
Merged

PratimMallick merged 1 commit into
developfrom
chore/and-1607-ring-poll-start-after-9s

Conversation

@aleksandar-apostolov

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

Copy link
Copy Markdown
Contributor

Goal

Closes AND-1607 — a caller whose coordinator websocket died silently waits 9s rather than 15s before the first ring_state read. Mirrors stream-video-js#2492.

Implementation

  • RingStatePollingConfig.DEFAULT_START_AFTER_MS 15s → 9s. In a 30s ring window reads land at 9/14/19/24/29s instead of 15/20/25s. Still overridable through startAfterMs.
  • The startAfterMs KDoc claimed the delay was kept well above the websocket ping interval so a merely slow answer would not poll. That stops being true at 9s — the health-check cycle is ~11s, and a callee taking ten seconds to answer now costs a read. It now states the trade it actually makes.
  • RingStatePollerTest drives virtual time off the default rather than a named constant, so its advances and expected read counts move with it.

DEFAULT_START_AFTER_MS is a public const val, so Kotlin inlines it: an integrator referencing the constant directly keeps 15_000 until they recompile. Callers taking the default pick it up on a version bump.

Testing

./gradlew :stream-video-android-core:testDebugUnitTest   # 1363 tests, 0 failures
./gradlew :stream-video-android-core:spotlessCheck
./gradlew :stream-video-android-core:apiCheck            # unchanged — the dump carries the field, not its value

Not re-verified on a device: the rescue path is untouched, only when the first read is issued.

Summary by CodeRabbit

  • Updates
    • Ring status polling now begins after 9 seconds of inactivity, down from 15 seconds, so dropped ring outcomes can be detected sooner.
    • Polling continues at 5-second intervals within the existing ring time limits. The shorter delay may also mean more polling while a callee is taking longer to answer.

Lowers RingStatePollingConfig.DEFAULT_START_AFTER_MS from 15s to 9s, so a
caller whose coordinator websocket died silently learns the ring outcome
sooner. In a 30s ring window reads land at 9/14/19/24/29s instead of
15/20/25s. Still overridable through startAfterMs.

The startAfterMs KDoc claimed the delay was kept above the websocket ping
interval; that is no longer true at 9s, so it now states the actual trade.
@aleksandar-apostolov aleksandar-apostolov added the pr:improvement Enhances an existing feature or code label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 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 5, 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 🟢

@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@aleksandar-apostolov
aleksandar-apostolov marked this pull request as ready for review October 6, 2026 08:42
@aleksandar-apostolov
aleksandar-apostolov requested a review from a team as a code owner October 6, 2026 08:42
@coderabbitai

coderabbitai Bot commented Oct 6, 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: dacb00e5-341e-44e3-b120-021ba66e150c
📥 Commits

Reviewing files that changed from the base of the PR and between 2cee1c8 and 0a40ba6.

📒 Files selected for processing (2)
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ringing/RingStatePollingConfig.kt
  • stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ringing/RingStatePollerTest.kt

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


Walkthrough

The default ring polling delay changes from 15 seconds to 9 seconds. Poller tests update their timing schedules and expected read counts to match.

Changes

Ring polling delay

Layer / File(s) Summary
Update default polling delay
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/ringing/RingStatePollingConfig.kt
The default delay changes to 9 seconds. The documentation describes the tradeoff between faster recovery from dropped outcomes and reads for slow answers.
Update polling timing tests
stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/ringing/RingStatePollerTest.kt
Tests update virtual-time schedules and expected read counts for the 9-second quiet period. The ring-event test checks that an event restarts that period.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: andremion

Merge Risk: ⚪ Minimal · up to 0a40b

The shorter delay is intended to recover sooner when the coordinator websocket dies silently, with a documented possibility of an extra read for slow answers. No unresolved merge risk is evident.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: ring-state polling starts after 9 seconds instead of 15 seconds.
Description check ✅ Passed The description covers the goal, implementation, and testing. It also explains the public constant’s inlining behavior and notes that device verification was not performed. UI materials and 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.
  • 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 ringing clock,
Nine seconds pass; the polls now knock.
The tests keep time and count each call,
A ring resets the quiet hall.
The rabbit hops, pleased with it all.

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

@rahul-lohra rahul-lohra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@PratimMallick
PratimMallick merged commit de39881 into develop Oct 7, 2026
19 checks passed
@PratimMallick
PratimMallick deleted the chore/and-1607-ring-poll-start-after-9s branch October 7, 2026 06:37
@stream-public-bot stream-public-bot added the released Included in a release label Oct 7, 2026
@stream-public-bot

Copy link
Copy Markdown
Collaborator

🚀 Available in v1.36.0

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 released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants