Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/stream_video/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Upcoming

### 🐞 Fixed

- Fixed connection quality indicator blanking after reconnect.

## 1.4.1

### 🔄 Changed
Expand Down
5 changes: 5 additions & 0 deletions packages/stream_video/lib/src/sfu/sfu_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import '../webrtc/model/rtc_video_dimension.dart';
import 'data/events/sfu_events.dart';
import 'data/models/sfu_audio_bitrate.dart';
import 'data/models/sfu_connection_info.dart';
import 'data/models/sfu_connection_quality.dart';
import 'data/models/sfu_model_mapper_extensions.dart';
import 'data/models/sfu_participant.dart';

Expand Down Expand Up @@ -61,6 +62,10 @@ extension SfuParticipantX on SfuParticipant {
isSpeaking: isSpeaking,
audioLevel: audioLevel,
isDominantSpeaker: isDominantSpeaker,
// Keep the last known quality to avoid the indicator blanking out on every reconnect.
connectionQuality: connectionQuality != SfuConnectionQuality.unspecified
? connectionQuality
: (existing?.connectionQuality ?? SfuConnectionQuality.unspecified),
Comment on lines +65 to +68

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect how connectionQuality is updated across event handlers
rg -n -B3 -A10 'connectionQuality' packages/stream_video/lib/src/call/state/mixins/state_sfu_mixin.dart

Repository: GetStream/stream-video-flutter

Length of output: 1394


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- state_sfu_mixin.dart outline ---'
ast-grep outline packages/stream_video/lib/src/call/state/mixins/state_sfu_mixin.dart --view expanded

echo
echo '--- sfu_extensions.dart outline ---'
ast-grep outline packages/stream_video/lib/src/sfu/sfu_extensions.dart --view expanded

echo
echo '--- relevant sections in state_sfu_mixin.dart ---'
sed -n '180,330p' packages/stream_video/lib/src/call/state/mixins/state_sfu_mixin.dart

echo
echo '--- relevant section in sfu_extensions.dart ---'
sed -n '1,140p' packages/stream_video/lib/src/sfu/sfu_extensions.dart

Repository: GetStream/stream-video-flutter

Length of output: 9213


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- all usages of toParticipantState ---'
rg -n 'toParticipantState\(' packages/stream_video/lib/src

echo
echo '--- all usages of sfuParticipantUpdated / sfuConnectionQualityChanged ---'
rg -n 'sfuParticipantUpdated|sfuConnectionQualityChanged' packages/stream_video/lib/src

echo
echo '--- SfuParticipant model ---'
fd -a 'sfu_participant.dart|SfuParticipant.*\.dart' packages/stream_video/lib/src

echo
echo '--- connectionQuality fields in SFU event/model definitions ---'
rg -n 'connectionQuality|ConnectionQuality' packages/stream_video/lib/src/sfu packages/stream_video/lib/src/call

echo
echo '--- surrounding event dispatch / rebuild code in call state ---'
rg -n -B4 -A8 'callParticipants|copyWith\(.*connectionQuality|toParticipantState' packages/stream_video/lib/src/call packages/stream_video/lib/src/sfu

Repository: GetStream/stream-video-flutter

Length of output: 50386


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- call_session reconnect / event handling context ---'
sed -n '650,730p' packages/stream_video/lib/src/call/session/call_session.dart

echo
echo '--- participant update event model and mapper ---'
sed -n '1,120p' packages/stream_video/lib/src/sfu/data/events/sfu_events.dart
echo
sed -n '240,310p' packages/stream_video/lib/src/sfu/data/events/sfu_event_mapper_extensions.dart

echo
echo '--- participant model copyWith and connectionQuality definition ---'
sed -n '1,140p' packages/stream_video/lib/src/sfu/data/models/sfu_participant.dart

Repository: GetStream/stream-video-flutter

Length of output: 12651


Preserve connection quality in the incremental SFU update paths
toParticipantState keeps the last known quality on full rebuilds, but sfuConnectionQualityChanged and sfuParticipantUpdated still write the incoming value directly. Since SfuParticipant can carry SfuConnectionQuality.unspecified, either path can still blank the indicator after reconnect. Apply the same fallback here or centralize it in a shared helper.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stream_video/lib/src/sfu/sfu_extensions.dart` around lines 65 - 68,
The incremental SFU update paths still overwrite a known connection quality with
unspecified, which can clear the indicator after reconnect. Update the logic in
sfuConnectionQualityChanged and sfuParticipantUpdated to preserve the previous
value when the incoming SfuParticipant.connectionQuality is
SfuConnectionQuality.unspecified, using the same fallback behavior already
applied in toParticipantState or by extracting a shared helper for the merge.

participantSource: participantSource,
);
}
Expand Down
Loading