Skip to content

Commit 0f6b3c2

Browse files
committed
Merge branch 'pr/538'
2 parents 5a648f3 + d18e88a commit 0f6b3c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/websocket/messageHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Embeddings } from '@langchain/core/embeddings';
55
import logger from '../utils/logger';
66
import db from '../db';
77
import { chats, messages as messagesSchema } from '../db/schema';
8-
import { eq, asc, gt } from 'drizzle-orm';
8+
import { eq, asc, gt, and } from 'drizzle-orm';
99
import crypto from 'crypto';
1010
import { getFileDetails } from '../utils/files';
1111
import MetaSearchAgent, {
@@ -238,7 +238,7 @@ export const handleMessage = async (
238238
} else {
239239
await db
240240
.delete(messagesSchema)
241-
.where(gt(messagesSchema.id, messageExists.id))
241+
.where(and(gt(messagesSchema.id, messageExists.id), eq(messagesSchema.chatId, parsedMessage.chatId)))
242242
.execute();
243243
}
244244
} catch (err) {

0 commit comments

Comments
 (0)