feat: implement service failure handling in background streaming
- Added a method to send failure notifications to Flutter when the background service fails to enter the foreground. - Implemented a broadcast receiver to handle service failure notifications and notify Flutter about the failure. - Enhanced the persistent streaming service to attempt recovery for failed streams. - Introduced heartbeat monitoring for SSE streams to detect stale connections and trigger recovery actions.
This commit is contained in:
@@ -1447,7 +1447,7 @@ Future<void> regenerateMessage(
|
||||
modelItem: modelItem,
|
||||
sessionId: effectiveSessionId,
|
||||
activeConversationId: activeConversation.id,
|
||||
api: api,
|
||||
api: api!,
|
||||
socketService: socketService,
|
||||
registerDeltaListener: registerDeltaListener,
|
||||
appendToLastMessage: (c) =>
|
||||
@@ -1719,7 +1719,7 @@ Future<void> _sendMessageInternal(
|
||||
final List<String> ids = msg.attachmentIds ?? const <String>[];
|
||||
if (ids.isNotEmpty) {
|
||||
final messageMap = await _buildMessagePayloadWithAttachments(
|
||||
api: api,
|
||||
api: api!,
|
||||
role: msg.role,
|
||||
cleanedText: cleaned,
|
||||
attachmentIds: ids,
|
||||
@@ -1995,7 +1995,7 @@ Future<void> _sendMessageInternal(
|
||||
modelItem: modelItem,
|
||||
sessionId: effectiveSessionId,
|
||||
activeConversationId: activeConversation?.id,
|
||||
api: api,
|
||||
api: api!,
|
||||
socketService: socketService,
|
||||
registerDeltaListener: registerDeltaListener,
|
||||
appendToLastMessage: (c) =>
|
||||
|
||||
Reference in New Issue
Block a user