fix: Prevent invalid map bounds #123

This commit is contained in:
Janez T
2026-03-16 22:16:36 +01:00
parent cfd233d38e
commit 993563f059
11 changed files with 129 additions and 25 deletions

View File

@@ -735,7 +735,10 @@ class MessagesProvider with ChangeNotifier {
}
if (message.isContactMessage) {
return existing.senderKeyShort == message.senderKeyShort;
// Match by sender key + sender timestamp (matches official app's DB
// uniqueness: contactPublicKey + senderTimestamp + text + txtType).
return existing.senderKeyShort == message.senderKeyShort &&
existing.senderTimestamp == message.senderTimestamp;
}
if (message.isChannelMessage) {