Skip to content

Improve join retries delay interval in video sdk#1651

Merged
aleksandar-apostolov merged 3 commits intodevelopfrom
improvement/rahullohra/join-call-retry
Apr 22, 2026
Merged

Improve join retries delay interval in video sdk#1651
aleksandar-apostolov merged 3 commits intodevelopfrom
improvement/rahullohra/join-call-retry

Conversation

@rahul-lohra
Copy link
Copy Markdown
Contributor

@rahul-lohra rahul-lohra commented Apr 17, 2026

Goal

Improve join-retries delay interval
The mathematical operation inside delay was wrong

Implementation

Corrected the operation inside delay

🎨 UI Changes

None

Testing

None

Summary by CodeRabbit

  • Bug Fixes
    • Fixed retry timing calculation for connection attempts. The system will now apply proper exponential backoff when join attempts fail, ensuring appropriate wait times between retry attempts.

@rahul-lohra rahul-lohra self-assigned this Apr 17, 2026
@rahul-lohra rahul-lohra added the pr:improvement Enhances an existing feature or code label Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 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.

@rahul-lohra rahul-lohra changed the title Improve join-retries delay interval Improve join retries delay interval in video sdk Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 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 🟢

@rahul-lohra rahul-lohra marked this pull request as ready for review April 20, 2026 04:58
@rahul-lohra rahul-lohra requested a review from a team as a code owner April 20, 2026 04:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Walkthrough

The Call.join method's retry delay calculation was corrected to apply proper operator precedence. The delay formula changed from delay(retryCount - 1 * 1000L) to delay((retryCount - 1) * 1000L), ensuring exponential backoff timing between retry attempts.

Changes

Cohort / File(s) Summary
Retry Backoff Fix
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt
Corrected retry delay calculation by adding parentheses to enforce multiplication before subtraction, fixing exponential backoff timing in the join retry loop.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A hop and a skip, through retry delays,
The parentheses danced in the clearest of ways,
Now backoff blooms bright with precision so right,
Where timing takes flight through the digital night! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing critical sections from the template including UI Changes details, Testing methodology, Contributor Checklist, and Reviewer Checklist, though the core sections are partially completed. Complete the Contributor and Reviewer checklists, clarify why testing is not applicable, and expand the Implementation section with more technical details about the fix.
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 (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: correcting the delay interval calculation in join retries for the video SDK.

✏️ 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 improvement/rahullohra/join-call-retry

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt`:
- Around line 571-574: The delay call runs even after the final failed join
attempt because delay((retryCount - 1) * 1000L) is executed unconditionally;
update the logic so the delay is only executed when another retry will occur
(e.g., guard the delay with a condition like retryCount < maxRetries or move the
delay inside the retry branch), referencing the retryCount variable and the
existing delay((retryCount - 1) * 1000L) expression in the Call.kt join routine
so no wait happens after the last attempt.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 734341a3-d99d-4462-9d2d-aaa635fe579d

📥 Commits

Reviewing files that changed from the base of the PR and between 7e360ce and b252445.

📒 Files selected for processing (1)
  • stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt

Copy link
Copy Markdown
Contributor

@aleksandar-apostolov aleksandar-apostolov left a comment

Choose a reason for hiding this comment

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

LGTM — operator precedence fix is correct and needed.

Agree with CodeRabbit's observation about the unnecessary 2s delay after the final failed attempt. Not a blocker for this PR, but worth addressing as a follow-up.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@aleksandar-apostolov aleksandar-apostolov merged commit 7c10e38 into develop Apr 22, 2026
11 of 12 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the improvement/rahullohra/join-call-retry branch April 22, 2026 08:35
@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: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.

3 participants