Skip to content

Commit 44af0c2

Browse files
committed
fix: guard dbChat sender fallback against from-me messages
1 parent 168d31f commit 44af0c2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/services/backend/actions/chat_actions.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,12 @@ class ChatActions {
339339
if (dbChat != null) {
340340
inputMessage.chat.target = dbChat;
341341

342-
// Fallback: resolve sender against this chat's linked participants
343-
if (handleToLink == null && inputMessage.handleId != null && inputMessage.handleId! > 0) {
342+
// Fallback: resolve sender against this chat's linked participants (skip
343+
// for from-me messages, same mislink reason as the hasSenderHandle guard above).
344+
if (handleToLink == null &&
345+
!(inputMessage.isFromMe ?? false) &&
346+
inputMessage.handleId != null &&
347+
inputMessage.handleId! > 0) {
344348
handleToLink =
345349
List<Handle>.from(dbChat.handles).firstWhereOrNull((h) => h.originalROWID == inputMessage.handleId);
346350
}

0 commit comments

Comments
 (0)