mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-21 19:47:21 -06:00
Merge pull request #351 from jaison-x/cache-chatwoot
fix(chatwoot): invalidate the conversation cache if reopen_conversation is false and the conversation was resolved
This commit is contained in:
commit
ed51f44ee8
@ -1037,6 +1037,17 @@ export class ChatwootService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// invalidate the conversation cache if reopen_conversation is false and the conversation was resolved
|
||||||
|
if (
|
||||||
|
this.provider.reopen_conversation === false &&
|
||||||
|
body.event === 'conversation_status_changed' &&
|
||||||
|
body.status === 'resolved' &&
|
||||||
|
body.meta?.sender?.identifier
|
||||||
|
) {
|
||||||
|
const keyToDelete = `createConversation-${instance.instanceName}-${body.meta.sender.identifier}`;
|
||||||
|
this.cache.delete(keyToDelete);
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.verbose('check if is bot');
|
this.logger.verbose('check if is bot');
|
||||||
if (
|
if (
|
||||||
!body?.conversation ||
|
!body?.conversation ||
|
||||||
|
Loading…
Reference in New Issue
Block a user