Skip to content

Commit 0f68590

Browse files
authored
Do not emit Reconnecting event during connection resume. (#459)
1 parent 4785179 commit 0f68590

File tree

4 files changed

+7
-31
lines changed

4 files changed

+7
-31
lines changed

lib/src/core/engine.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,6 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
746746
'resumeConnection: Timed out waiting for SignalReconnectedEvent'),
747747
);
748748

749-
events.emit(const EngineSignalResumedEvent());
750-
751749
logger.fine('resumeConnection: reason: ${reason.name}');
752750

753751
if (_hasPublished) {
@@ -774,7 +772,7 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
774772
logger.fine('resumeConnection: primary connected');
775773
}
776774

777-
events.emit(const EngineReconnectedEvent());
775+
events.emit(const EngineResumedEvent());
778776
}
779777

780778
@internal

lib/src/core/room.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,13 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
357357
});
358358

359359
void _setUpEngineListeners() => _engineListener
360-
..on<EngineReconnectedEvent>((event) async {
361-
events.emit(const RoomReconnectedEvent());
360+
..on<EngineResumedEvent>((event) async {
362361
// re-send tracks permissions
363362
localParticipant?.sendTrackSubscriptionPermissions();
364363
notifyListeners();
365364
})
366365
..on<EngineFullRestartingEvent>((event) async {
367-
events.emit(const RoomRestartingEvent());
366+
events.emit(const RoomReconnectingEvent());
368367

369368
// clean up RemoteParticipants
370369
var copy = _remoteParticipants.values.toList();
@@ -385,8 +384,6 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
385384
notifyListeners();
386385
})
387386
..on<EngineRestartedEvent>((event) async {
388-
events.emit(const RoomRestartedEvent());
389-
390387
// re-publish all tracks
391388
await localParticipant?.rePublishAllTracks();
392389

@@ -398,9 +395,9 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
398395
}
399396
}
400397
notifyListeners();
398+
events.emit(const RoomReconnectedEvent());
401399
})
402-
..on<EngineReconnectingEvent>((event) async {
403-
events.emit(const RoomReconnectingEvent());
400+
..on<EngineResumingEvent>((event) async {
404401
await _sendSyncState();
405402
notifyListeners();
406403
})

lib/src/events.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,6 @@ class RoomReconnectedEvent with RoomEvent {
9090
String toString() => '${runtimeType}()';
9191
}
9292

93-
class RoomRestartingEvent with RoomEvent {
94-
const RoomRestartingEvent();
95-
96-
@override
97-
String toString() => '${runtimeType}()';
98-
}
99-
100-
class RoomRestartedEvent with RoomEvent {
101-
const RoomRestartedEvent();
102-
103-
@override
104-
String toString() => '${runtimeType}()';
105-
}
106-
10793
/// Disconnected from the room
10894
/// Emitted by [Room].
10995
class RoomDisconnectedEvent with RoomEvent {

lib/src/internal/events.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,15 @@ class EngineReconnectingEvent with InternalEvent, EngineEvent {
197197
}
198198

199199
@internal
200-
class EngineReconnectedEvent with InternalEvent, EngineEvent {
201-
const EngineReconnectedEvent();
200+
class EngineResumedEvent with InternalEvent, EngineEvent {
201+
const EngineResumedEvent();
202202
}
203203

204204
@internal
205205
class EngineResumingEvent with InternalEvent, EngineEvent {
206206
const EngineResumingEvent();
207207
}
208208

209-
@internal
210-
class EngineSignalResumedEvent with EngineEvent, InternalEvent {
211-
const EngineSignalResumedEvent();
212-
}
213-
214209
@internal
215210
class SignalConnectedEvent with SignalEvent, InternalEvent {
216211
const SignalConnectedEvent();

0 commit comments

Comments
 (0)