File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ patch type="fixed" "Fix missing RoomReconnectedEvent and incorrect SyncState timing during signal-only reconnection"
Original file line number Diff line number Diff line change @@ -499,6 +499,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
499499 ..on < EngineResumedEvent > ((event) async {
500500 // re-send tracks permissions
501501 localParticipant? .sendTrackSubscriptionPermissions ();
502+ events.emit (const RoomReconnectedEvent ());
502503 notifyListeners ();
503504 })
504505 ..on < EngineFullRestartingEvent > ((event) async {
@@ -536,9 +537,12 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
536537 notifyListeners ();
537538 })
538539 ..on < EngineResumingEvent > ((event) async {
539- await _sendSyncState ( );
540+ events. emit ( const RoomResumingEvent () );
540541 notifyListeners ();
541542 })
543+ ..on < SignalReconnectedEvent > ((event) async {
544+ await _sendSyncState ();
545+ })
542546 ..on < EngineAttemptReconnectEvent > ((event) async {
543547 events.emit (RoomAttemptReconnectEvent (
544548 attempt: event.attempt,
Original file line number Diff line number Diff line change @@ -66,16 +66,30 @@ class RoomConnectedEvent with RoomEvent {
6666 String toString () => '${runtimeType }(room: ${room }, metadata: ${metadata })' ;
6767}
6868
69+ /// Base type for reconnecting events. Listen for this type to handle
70+ /// both full reconnects and signal-only reconnects.
71+ mixin ReconnectingEvent implements RoomEvent {}
72+
6973/// When the connection to the server has been interrupted and it's attempting
70- /// to reconnect.
74+ /// a full reconnect (peer connections are reset, media is interrupted) .
7175/// Emitted by [Room] .
72- class RoomReconnectingEvent with RoomEvent {
76+ class RoomReconnectingEvent with RoomEvent , ReconnectingEvent {
7377 const RoomReconnectingEvent ();
7478
7579 @override
7680 String toString () => '${runtimeType }()' ;
7781}
7882
83+ /// When the signal connection has been interrupted and it's attempting
84+ /// to resume. Peer connections remain active during this type of reconnect.
85+ /// Emitted by [Room] .
86+ class RoomResumingEvent with RoomEvent , ReconnectingEvent {
87+ const RoomResumingEvent ();
88+
89+ @override
90+ String toString () => '${runtimeType }()' ;
91+ }
92+
7993/// report the number of attempts to reconnect to the room.
8094class RoomAttemptReconnectEvent with RoomEvent {
8195 final int attempt;
You can’t perform that action at this time.
0 commit comments