-
Notifications
You must be signed in to change notification settings - Fork 39
fix: dynascale manager doesnt pick up updated dimensions all the time #2001
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
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 fixes a timing issue in the DynascaleManager where participant dimension updates were not being picked up reliably due to stale data from RxJS shareReplay with refCount: true.
Key Changes:
- Introduced
getParticipantsSnapshot()method in CallState to bypass the observable pipeline and read directly from the BehaviorSubject - Updated DynascaleManager to use the snapshot method, avoiding stale data when there are no active subscribers
- Fixed TrackSubscriber to properly unsubscribe from tracks when participants stop publishing
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/client/src/store/CallState.ts | Added getParticipantsSnapshot() method to provide synchronous access to participants data, bypassing potential timing issues with shareReplay |
| packages/client/src/helpers/DynascaleManager.ts | Updated trackSubscriptions getter to use getParticipantsSnapshot() and optimized by caching videoTrackSubscriptionOverrides lookup, includes explicit local participant filtering |
| packages/react-native-sdk/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx | Added !isPublishing condition to unsubscribe when participant stops publishing, removed redundant distinctUntilChanged() operator |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // isPublishing is not used here, but we need to keep it for the subscription | ||
| // to send the dimensions again when the participant starts publishing the track again |
Copilot
AI
Nov 17, 2025
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.
The comment states "isPublishing is not used here" but it is now being used in the condition on line 89 (!isVisible || !isPublishing). Please update the comment to reflect the actual usage, for example: "isPublishing is used to unsubscribe when the participant stops publishing, and to re-subscribe when they start publishing again".
| // isPublishing is not used here, but we need to keep it for the subscription | |
| // to send the dimensions again when the participant starts publishing the track again | |
| // isPublishing is used to unsubscribe when the participant stops publishing, | |
| // and to re-subscribe when they start publishing again, ensuring dimensions are sent appropriately. |
💡 Overview
changesobject show that changes are reflected in the call statebut dynascale manager, does not read the participant update.. it still shows that participant dimensions are undefined
📝 Implementation notes
The root cause is shareReplay({ refCount: true }) on remoteParticipants$. When there are no active subscribers:
The proper fix is to make the trackSubscriptions getter read directly from the BehaviorSubject, bypassing the shareReplay:
🎫 Ticket: https://linear.app/stream/issue/XYZ-123
📑 Docs: https://github.com/GetStream/docs-content/pull/