diff --git a/apps/viewer/src/pages/api/v1/workspaces/[workspaceId]/whatsapp/[credentialsId]/webhook.ts b/apps/viewer/src/pages/api/v1/workspaces/[workspaceId]/whatsapp/[credentialsId]/webhook.ts index 18592efae..9611ae765 100644 --- a/apps/viewer/src/pages/api/v1/workspaces/[workspaceId]/whatsapp/[credentialsId]/webhook.ts +++ b/apps/viewer/src/pages/api/v1/workspaces/[workspaceId]/whatsapp/[credentialsId]/webhook.ts @@ -87,7 +87,11 @@ const processWhatsAppReply = async ({ .metadata.phone_number_id if (!phoneNumberId) return { message: 'No phone number id found' } console.log('Received message:', receivedMessage) - console.log('sessionId', `wa-${phoneNumberId}-${receivedMessage.from}`) + console.log( + 'sessionId', + `wa-${phoneNumberId}-${receivedMessage.from}`, + new Date().toISOString() + ) try { const { message } = await resumeWhatsAppFlow({ receivedMessage, diff --git a/packages/bot-engine/whatsapp/resumeWhatsAppFlow.ts b/packages/bot-engine/whatsapp/resumeWhatsAppFlow.ts index 4391cb753..cd1ec3050 100644 --- a/packages/bot-engine/whatsapp/resumeWhatsAppFlow.ts +++ b/packages/bot-engine/whatsapp/resumeWhatsAppFlow.ts @@ -10,9 +10,9 @@ import { getSession } from '../queries/getSession' import { continueBotFlow } from '../continueBotFlow' import { decrypt } from '@typebot.io/lib/api/encryption/decrypt' import { saveStateToDatabase } from '../saveStateToDatabase' -import prisma from '@typebot.io/lib/prisma' import { isDefined } from '@typebot.io/lib/utils' import { Reply } from '../types' +import { PrismaClient } from '@typebot.io/prisma' type Props = { receivedMessage: WhatsAppIncomingMessage @@ -199,7 +199,9 @@ const getCredentials = async ({ if (!credentialsId) return - console.log('prisma go') + console.log('prisma client') + const prisma = new PrismaClient() + console.log('prisma go', new Date().toISOString()) const credentials = await prisma.credentials.findUnique({ where: { id: credentialsId,