From 89230b2e822c44cf94e4132152df08668a91eec4 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Tue, 29 Oct 2024 19:12:09 +0100 Subject: [PATCH] fix(api): persistence contextVars --- api/src/chat/services/conversation.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/chat/services/conversation.service.ts b/api/src/chat/services/conversation.service.ts index 7845427..1172c21 100644 --- a/api/src/chat/services/conversation.service.ts +++ b/api/src/chat/services/conversation.service.ts @@ -183,8 +183,10 @@ export class ConversationService extends BaseService< } //TODO: add check if nothing changed don't update + const criteria = + typeof convo.sender === 'object' ? convo.sender.id : convo.sender; - await this.subscriberService.updateOne(convo.sender, { + await this.subscriberService.updateOne(criteria, { context: profile.context, });