Matthias Nott
2026-03-22 c4ce6380fbfa55f22e9c20bb2ccffe4456ed9683
lib/screens/chat_screen.dart
....@@ -14,7 +14,7 @@
1414 import '../providers/providers.dart';
1515 import '../services/audio_service.dart';
1616 import '../services/message_store.dart';
17
-import '../services/websocket_service.dart';
17
+import '../services/mqtt_service.dart';
1818 import '../theme/app_theme.dart';
1919 import '../widgets/command_bar.dart';
2020 import '../widgets/input_bar.dart';
....@@ -34,7 +34,7 @@
3434
3535 class _ChatScreenState extends ConsumerState<ChatScreen>
3636 with WidgetsBindingObserver {
37
- WebSocketService? _ws;
37
+ MqttService? _ws;
3838 final TextEditingController _textController = TextEditingController();
3939 final ScrollController _scrollController = ScrollController();
4040 final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
....@@ -125,7 +125,7 @@
125125 if (config == null) return;
126126 }
127127
128
- _ws = WebSocketService(config: config);
128
+ _ws = MqttService(config: config);
129129 _ws!.onStatusChanged = (status) {
130130 if (mounted) {
131131 ref.read(wsStatusProvider.notifier).state = status;
....@@ -135,10 +135,11 @@
135135 _ws!.onOpen = () {
136136 final activeId = ref.read(activeSessionIdProvider);
137137 _sendCommand('sync', activeId != null ? {'activeSessionId': activeId} : null);
138
+ // catch_up is still available during the transition period
138139 _sendCommand('catch_up', {'lastSeq': _lastSeq});
139140 };
140141 _ws!.onError = (error) {
141
- debugPrint('WS error: $error');
142
+ debugPrint('MQTT error: $error');
142143 };
143144
144145 NavigateNotifier.instance = NavigateNotifier(