Skip to content

Commit 712b333

Browse files
author
Thomas Belin
authored
runfix: Fix matching conversations with ids in events (#11975)
1 parent ea9bd7a commit 712b333

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/script/conversation/ConversationRepository.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,9 +1791,14 @@ export class ConversationRepository {
17911791
return Promise.reject(new Error('Conversation Repository Event Handling: Event missing'));
17921792
}
17931793

1794-
const {conversation, qualified_conversation, type} = eventJson;
1795-
const conversationId = qualified_conversation || {domain: null, id: conversation};
1796-
this.logger.info(`Handling event '${type}' in conversation '${conversationId}' (Source: ${eventSource})`);
1794+
const {conversation, qualified_conversation, data: eventData, type} = eventJson;
1795+
// data.conversationId is always the conversationId that should be read first. If not found we can fallback to qualified_conversation or conversation
1796+
const conversationId: QualifiedId = eventData.conversationId
1797+
? {domain: '', id: eventData.conversationId}
1798+
: qualified_conversation || {domain: null, id: conversation};
1799+
this.logger.info(
1800+
`Handling event '${type}' in conversation '${conversationId.id}/${conversationId.domain}' (Source: ${eventSource})`,
1801+
);
17971802

17981803
const inSelfConversation =
17991804
conversationId === this.conversationState.self_conversation() && this.conversationState.self_conversation().id;

0 commit comments

Comments
 (0)