[stable-24.0] fix: send local state when ICE connects instead of at participant-add time#6241
Merged
Merged
Conversation
… time When a participant was added, LocalStateBroadcasterNoMcu.handleCallParticipantAdded was called with a snapshot of the current ParticipantUiState. At that moment the PeerConnectionWrapper did not yet exist, so the data channel was unavailable and all state messages (audioOn/videoOn/speaking) were silently dropped. Subsequent ICE transitions were never observed, so the remote participant never learned the local audio/video state. Fix: LocalStateBroadcasterNoMcu now accepts a live StateFlow<ParticipantUiState> and collects it internally via IceConnectionStateObserver. State is sent on every false→true transition of isConnected, i.e. exactly when the data channel becomes ready. CallActivity passes the live StateFlow instead of the snapshot value. A non-abstract default overload is added to LocalStateBroadcaster so that LocalStateBroadcasterMcu continues to work unchanged. Tests: - LocalStateBroadcasterNoMcuTest: drives state via MutableStateFlow; fails without the fix because updates after handleCallParticipantAdded are never seen - CallParticipantStateBroadcastIntegrationTest: full pipeline test through CallViewModel → ParticipantHandler → LocalStateBroadcasterNoMcu with a mocked PeerConnectionWrapper driving ICE transitions - CallActivityAddParticipantTest: Robolectric test verifying that CallActivity passes the live StateFlow object (not a snapshot) to the broadcaster Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Alain Lauzon <alauzon@alainlauzon.com>
Contributor
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/26620376760/artifacts/7284003331 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of PR #6086