Matthias Nott
2026-03-24 62fc4821c4a66313c300328aa1cf19808a41e0de
lib/screens/chat_screen.dart
....@@ -164,6 +164,12 @@
164164 _sendCommand('sync', activeId != null ? {'activeSessionId': activeId} : null);
165165 // catch_up is sent after sessions arrive (in _handleSessions)
166166 };
167
+ _ws!.onResume = () {
168
+ // App came back from background with connection still alive.
169
+ // Send catch_up to fetch any messages missed during suspend.
170
+ _chatLog('onResume: sending catch_up with lastSeq=$_lastSeq');
171
+ _sendCommand('catch_up', {'lastSeq': _lastSeq});
172
+ };
167173 _ws!.onError = (error) {
168174 debugPrint('MQTT error: $error');
169175 };