Skip to content

[AND-446] Allow access to Call objects directly from QueriedCalls #1363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

aleksandar-apostolov
Copy link
Contributor

🎯 Goal

queryCalls now correctly exposes access to watchable Call objects.

🛠 Implementation details

A new queriedCalls map is added which handles calls that are queried with the watch = true flag. These calls are then returned via the QueriedCalls response under the field watchedCalls these calls can then be observed and will receive events from the client and their CallState will be updated.

Copy link
Contributor

@Copilot 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 implements direct access to watchable Call objects via QueriedCalls by maintaining an internal queriedCalls map and updating related client methods and tests.

  • Changes in test files ensure that queries with watch flags yield expected behavior.
  • Client logic now manages a separate queriedCalls map, handles event propagation for watched calls, and re-watches calls on reconnection.
  • Data conversion and model definitions have been updated to include the new watchedCalls field.

Reviewed Changes

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

Show a summary per file
File Description
stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/SfuSocketStateEventTest.kt Changed visibility of toUserResponse from private to internal.
stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/CallStateTest.kt Added tests to verify queriedCall behavior with/without watch.
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/utils/DomainUtils.kt Updated conversion function to include watchedCalls parameter.
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/model/QueriedCalls.kt Extended model to include watchedCalls list.
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt Introduced queriedCalls management and updated event handling.
Files not reviewed (1)
  • stream-video-android-core/api/stream-video-android-core.api: Language not supported

Copy link
Contributor

github-actions bot commented Apr 23, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 11.21 MB 11.23 MB 0.02 MB 🟢
stream-video-android-ui-xml 5.68 MB 5.66 MB -0.02 MB 🚀
stream-video-android-ui-compose 5.83 MB 5.83 MB 0.00 MB 🟢

…ndroid/core/StreamVideoClient.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

Looks good in general, mostly we should re-check the hardcoded filter. You should probably store the original query in order to rewatch it.

Copy link
Contributor

@Copilot 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 enables direct access to Call objects from QueriedCalls by exposing a new queriedCalls map and modifying queryCalls behavior.

  • Updated the access modifier for the User extension function in SfuSocketStateEventTest.
  • Revised and added tests in CallStateTest to verify behavior for both watch true and false cases, including ensuring watchedCalls is accurate.
  • Modified DomainUtils, QueriedCalls, and StreamVideoClient to support tracking and re-watching of queried calls.

Reviewed Changes

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

Show a summary per file
File Description
SfuSocketStateEventTest.kt Changed access modifier from private to internal for toUserResponse.
CallStateTest.kt Updated test names and behavior to differentiate between watched and non-watched call queries and added new tests.
DomainUtils.kt Updated toQueriedCalls to accept a watchedCalls parameter.
QueriedCalls.kt Introduced watchedCalls field in the data model.
StreamVideoClient.kt Added queriedCalls and savedQueryFilters, updated reconnection logic, event propagation, and introduced queriedCall and rewatchOwnCalls methods.
Files not reviewed (1)
  • stream-video-android-core/api/stream-video-android-core.api: Language not supported
Comments suppressed due to low confidence (2)

stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt:379

  • The error log message appears to be missing a closing parenthesis. Please add it to ensure the log is correctly formatted.
logger.e { "Failed to re-watch calls (${it.value}" }

stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt:906

  • The condition 'if (watch)' is redundant since 'watch' is always true in this context. Consider removing the check to simplify the code.
if (watch) {

@aleksandar-apostolov aleksandar-apostolov added the pr:new-feature Adds new functionality label May 8, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants