the trigger post processing slack notifier should only look for the analyst post processing messages

This commit is contained in:
dal 2025-07-10 09:37:45 -06:00
parent 7a5b5e28b8
commit 06a5eb38e6
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 10 additions and 1 deletions

View File

@ -88,7 +88,16 @@ export async function getExistingSlackMessageForChat(chatId: string): Promise<{
})
.from(messagesToSlackMessages)
.innerJoin(messages, eq(messages.id, messagesToSlackMessages.messageId))
.where(eq(messages.chatId, chatId))
.innerJoin(
slackMessageTracking,
eq(slackMessageTracking.id, messagesToSlackMessages.slackMessageId)
)
.where(
and(
eq(messages.chatId, chatId),
eq(slackMessageTracking.messageType, SlackMessageSource.ANALYST_MESSAGE_POST_PROCESSING)
)
)
.orderBy(messages.createdAt)
.limit(1);