feat: enhance location update feedback and improve message retry error handling

This commit is contained in:
zjs81
2026-03-14 09:54:50 -07:00
parent 91608ff09e
commit fa4da979af
2 changed files with 13 additions and 3 deletions
+10 -1
View File
@@ -184,7 +184,16 @@ class MessageRetryService extends ChangeNotifier {
final messageId = queue.removeAt(0);
if (_pendingMessages.containsKey(messageId)) {
_activeMessages.add(messageId);
_attemptSend(messageId);
_attemptSend(messageId).catchError((e) {
debugPrint('_attemptSend threw for $messageId: $e');
final msg = _pendingMessages[messageId];
if (msg != null) {
final failed = msg.copyWith(status: MessageStatus.failed);
_pendingMessages[messageId] = failed;
_updateMessageCallback?.call(failed);
}
_onMessageResolved(messageId, contactKey);
});
return;
}
// Message was cancelled/cleaned up while queued — try next