From 4276c57388ddaf44d01639e1f09d04bb4b00fe82 Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Mon, 16 Mar 2026 15:48:04 +0900 Subject: [PATCH 1/2] fixes --- lib/src/core/room.dart | 6 +++++- lib/src/events.dart | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/src/core/room.dart b/lib/src/core/room.dart index d35317af7..a34043056 100644 --- a/lib/src/core/room.dart +++ b/lib/src/core/room.dart @@ -499,6 +499,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable { ..on((event) async { // re-send tracks permissions localParticipant?.sendTrackSubscriptionPermissions(); + events.emit(const RoomReconnectedEvent()); notifyListeners(); }) ..on((event) async { @@ -536,9 +537,12 @@ class Room extends DisposableChangeNotifier with EventsEmittable { notifyListeners(); }) ..on((event) async { - await _sendSyncState(); + events.emit(const RoomResumingEvent()); notifyListeners(); }) + ..on((event) async { + await _sendSyncState(); + }) ..on((event) async { events.emit(RoomAttemptReconnectEvent( attempt: event.attempt, diff --git a/lib/src/events.dart b/lib/src/events.dart index 2161a7388..816be2bd6 100644 --- a/lib/src/events.dart +++ b/lib/src/events.dart @@ -66,16 +66,30 @@ class RoomConnectedEvent with RoomEvent { String toString() => '${runtimeType}(room: ${room}, metadata: ${metadata})'; } +/// Base type for reconnecting events. Listen for this type to handle +/// both full reconnects and signal-only reconnects. +mixin ReconnectingEvent implements RoomEvent {} + /// When the connection to the server has been interrupted and it's attempting -/// to reconnect. +/// a full reconnect (peer connections are reset, media is interrupted). /// Emitted by [Room]. -class RoomReconnectingEvent with RoomEvent { +class RoomReconnectingEvent with RoomEvent, ReconnectingEvent { const RoomReconnectingEvent(); @override String toString() => '${runtimeType}()'; } +/// When the signal connection has been interrupted and it's attempting +/// to resume. Peer connections remain active during this type of reconnect. +/// Emitted by [Room]. +class RoomResumingEvent with RoomEvent, ReconnectingEvent { + const RoomResumingEvent(); + + @override + String toString() => '${runtimeType}()'; +} + /// report the number of attempts to reconnect to the room. class RoomAttemptReconnectEvent with RoomEvent { final int attempt; From 2596de7e7cc8ef5eac69a7ef6fbae5e07d543695 Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Mon, 16 Mar 2026 15:48:12 +0900 Subject: [PATCH 2/2] changes --- .changes/fix-signal-resume-events | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changes/fix-signal-resume-events diff --git a/.changes/fix-signal-resume-events b/.changes/fix-signal-resume-events new file mode 100644 index 000000000..d9f2e3c4f --- /dev/null +++ b/.changes/fix-signal-resume-events @@ -0,0 +1 @@ +patch type="fixed" "Fix missing RoomReconnectedEvent and incorrect SyncState timing during signal-only reconnection"