-
Notifications
You must be signed in to change notification settings - Fork 43
[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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt
Outdated
Show resolved
Hide resolved
SDK Size Comparison 📏
|
…ndroid/core/StreamVideoClient.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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.
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt
Show resolved
Hide resolved
stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/CallStateTest.kt
Outdated
Show resolved
Hide resolved
stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoClient.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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) {
🎯 Goal
queryCalls
now correctly exposes access to watchableCall
objects.🛠 Implementation details
A new
queriedCalls
map is added which handles calls that are queried with thewatch = true
flag. These calls are then returned via theQueriedCalls
response under the fieldwatchedCalls
these calls can then be observed and will receive events from the client and theirCallState
will be updated.