fix kafka attachment message id binding
This commit is contained in:
@@ -128,7 +128,14 @@ func executeKafkaFileAttachmentsBind(tenantID types.TenantID, payload kafkaFileL
|
||||
return types.ErrMalformed
|
||||
}
|
||||
if types.GetTopicCat(payload.Topic) != types.TopicCatGrp {
|
||||
return store.Files.LinkAttachments(tenantID, "", msgID, payload.AttachmentURLs)
|
||||
// Kafka persistence writes the decoded UID as the SQL message primary key,
|
||||
// while the lifecycle payload carries the externally encoded UID. The
|
||||
// file-link adapter expects the raw SQL ID, so decode it before binding.
|
||||
databaseMsgID := types.Uid(store.DecodeUid(msgID))
|
||||
if databaseMsgID.IsZero() {
|
||||
return types.ErrMalformed
|
||||
}
|
||||
return store.Files.LinkAttachments(tenantID, "", databaseMsgID, payload.AttachmentURLs)
|
||||
}
|
||||
uploader := types.ParseUserId(payload.UserID)
|
||||
if uploader.IsZero() {
|
||||
|
||||
Reference in New Issue
Block a user