fix: local and remote returning different data (#7843)

This commit is contained in:
Richard Shiue 2025-04-28 13:17:16 +08:00 committed by GitHub
parent 66fac524c1
commit 2b03c34df1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,6 +72,7 @@ class ChatBloc extends Bloc<ChatEvent, ChatState> {
final request = ViewIdPB(value: chatId);
unawaited(FolderEventCloseView(request).send());
selectedSourcesNotifier.dispose();
chatController.dispose();
return super.close();
}
@ -576,6 +577,7 @@ class ChatBloc extends Bloc<ChatEvent, ChatState> {
if (temporaryMessageIDMap.containsKey(messageId)) {
messageId = temporaryMessageIDMap[messageId]!;
}
final metadata = message.metadata == 'null' ? '[]' : message.metadata;
return TextMessage(
author: User(id: message.authorId),
@ -583,7 +585,7 @@ class ChatBloc extends Bloc<ChatEvent, ChatState> {
text: message.content,
createdAt: message.createdAt.toDateTime(),
metadata: {
messageRefSourceJsonStringKey: message.metadata,
messageRefSourceJsonStringKey: metadata,
},
);
}