mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-22 06:08:54 -04:00
simplify reconciliation
This commit is contained in:
parent
bf38c2c44d
commit
4797184a1a
12 changed files with 512 additions and 345 deletions
|
@ -15,6 +15,7 @@ import '../../account_manager/account_manager.dart';
|
|||
import '../../contacts/contacts.dart';
|
||||
import '../../conversation/conversation.dart';
|
||||
import '../../proto/proto.dart' as proto;
|
||||
import '../../tools/tools.dart';
|
||||
import '../models/chat_component_state.dart';
|
||||
import '../models/message_state.dart';
|
||||
import '../models/window_state.dart';
|
||||
|
@ -383,13 +384,13 @@ class ChatComponentCubit extends Cubit<ChatComponentState> {
|
|||
if (chatMessage == null) {
|
||||
continue;
|
||||
}
|
||||
chatMessages.insert(0, chatMessage);
|
||||
if (!tsSet.add(chatMessage.id)) {
|
||||
// ignore: avoid_print
|
||||
print('duplicate id found: ${chatMessage.id}:\n'
|
||||
'Messages:\n${messagesState.window}\n'
|
||||
'ChatMessages:\n$chatMessages');
|
||||
assert(false, 'should not have duplicate id');
|
||||
log.error('duplicate id found: ${chatMessage.id}'
|
||||
// '\nMessages:\n${messagesState.window}'
|
||||
// '\nChatMessages:\n$chatMessages'
|
||||
);
|
||||
} else {
|
||||
chatMessages.insert(0, chatMessage);
|
||||
}
|
||||
}
|
||||
return currentState.copyWith(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue