Skip to content

Commit

Permalink
chore: Add source to decryption error log (WPB-14262)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisamir98 committed Dec 19, 2024
1 parent 96b3f2e commit 5b4873a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/script/event/EventRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export class EventRepository {
case EventValidation.VALID:
let eventToProcess: IncomingEvent | undefined = event;
if (event.type === CONVERSATION_EVENT.OTR_MESSAGE_ADD || event.type === CONVERSATION_EVENT.MLS_MESSAGE_ADD) {
eventToProcess = await this.mapEncryptedEvent(event, {decryptedData, decryptionError});
eventToProcess = await this.mapEncryptedEvent(event, {decryptedData, decryptionError}, source);
}
if (!eventToProcess) {
return event;
Expand All @@ -397,9 +397,11 @@ export class EventRepository {
private async mapEncryptedEvent(
event: ConversationOtrMessageAddEvent | ConversationMLSMessageAddEvent,
{decryptedData, decryptionError}: Pick<HandledEventPayload, 'decryptedData' | 'decryptionError'>,
source: EventSource,
): Promise<IncomingEvent | undefined> {
if (decryptionError) {
this.logger.warn(`Decryption Error: '${event.type}'`, {
source,
eventType: event.type,
date: event.time,
code: decryptionError.code,
Expand Down

0 comments on commit 5b4873a

Please sign in to comment.