Skip to content

[stable-24.0] fix: send local state when ICE connects instead of at participant-add time#6241

Merged
mahibi merged 1 commit into
stable-24.0from
backport/6086/stable-24.0
May 29, 2026
Merged

[stable-24.0] fix: send local state when ICE connects instead of at participant-add time#6241
mahibi merged 1 commit into
stable-24.0from
backport/6086/stable-24.0

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented May 29, 2026

Backport of PR #6086

… 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>
@backportbot backportbot Bot requested a review from mahibi May 29, 2026 05:42
@backportbot backportbot Bot added 3. to review Waiting for reviews feedback-requested labels May 29, 2026
@backportbot backportbot Bot added this to the 24.0.0 milestone May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/26620376760/artifacts/7284003331
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@mahibi mahibi merged commit b1782f7 into stable-24.0 May 29, 2026
14 of 15 checks passed
@mahibi mahibi deleted the backport/6086/stable-24.0 branch May 29, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants