-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connect attachement to conversation #386
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if (message) { | ||
const existingContact = await prisma.contact.findUnique({ | ||
where: { | ||
id: `${message.from.id}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here contact.id is set to telegram from'id
We should not mix external unknown id types with our own
That's why there is an externalId column
if (!existingContact) { | ||
await prisma.contact.create({ | ||
data: { | ||
id: `${message.from.id}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use telegram id here
@@ -333,11 +287,11 @@ const webhook = async (req: AppNextApiRequest, res: NextApiResponse) => { | |||
const chatResponse = await handleChatMessage({ | |||
agent, | |||
channel: ConversationChannel.telegram, | |||
channelExternalId: `${chatId}`, | |||
channelExternalId: `${externalId}${chatId}`, | |||
conversationId: `${chatId}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conversationId should not be an unknown external ID type
@@ -333,11 +287,11 @@ const webhook = async (req: AppNextApiRequest, res: NextApiResponse) => { | |||
const chatResponse = await handleChatMessage({ | |||
agent, | |||
channel: ConversationChannel.telegram, | |||
channelExternalId: `${chatId}`, | |||
channelExternalId: `${externalId}${chatId}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this combo needed? chatId not enough?
No description provided.