Skip to content

Commit e819727

Browse files
authored
Fix wrong conversation showing after QR scan (#520)
Skip inviteTag-based conversation matching when the tag is empty. When a discovered XMTP group has an empty inviteTag (metadata not yet synced or read failure), the query filter(inviteTag == "") would match any existing conversation that also has an empty tag, causing the wrong conversation's clientConversationId to be merged with the new group.
1 parent 18c0eb4 commit e819727

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ConvosCore/Sources/ConvosCore/Storage/Writers/ConversationWriter.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ class ConversationWriter: ConversationWriterProtocol, @unchecked Sendable {
401401
// Apply the preserved timestamp
402402
var conversationToSave = dbConversation.with(imageLastRenewed: imageLastRenewed)
403403

404-
if let localConversation = try DBConversation
404+
if !dbConversation.inviteTag.isEmpty,
405+
let localConversation = try DBConversation
405406
.filter(DBConversation.Columns.inviteTag == dbConversation.inviteTag)
406407
.filter(DBConversation.Columns.clientConversationId != dbConversation.clientConversationId)
407408
.fetchOne(db) {

0 commit comments

Comments
 (0)