diff --git a/lib/tunnelbroker/use-peer-to-peer-message-handler.js b/lib/tunnelbroker/use-peer-to-peer-message-handler.js --- a/lib/tunnelbroker/use-peer-to-peer-message-handler.js +++ b/lib/tunnelbroker/use-peer-to-peer-message-handler.js @@ -26,6 +26,7 @@ import { dmOperationSpecificationTypes } from '../shared/dm-ops/dm-op-utils.js'; import { useProcessDMOperation } from '../shared/dm-ops/process-dm-ops.js'; import { IdentityClientContext } from '../shared/identity-client-context.js'; +import { useStaffAlert } from '../shared/staff-utils.js'; import type { DeviceOlmInboundKeys } from '../types/identity-service-types.js'; import { peerToPeerMessageTypes, @@ -203,6 +204,8 @@ const resendPeerToPeerMessages = useResendPeerToPeerMessages(); const { createOlmSessionsWithUser } = usePeerOlmSessionsCreatorContext(); + const { showAlertToStaff } = useStaffAlert(); + return React.useCallback( async (message: PeerToPeerMessage, messageID: string) => { if (message.type === peerToPeerMessageTypes.OUTBOUND_SESSION_CREATION) { @@ -276,6 +279,11 @@ `${senderDeviceID}: ${errorMessage}, ` + `session version: ${sessionVersion}`, ); + showAlertToStaff( + 'Error creating inbound session with device ', + `${senderDeviceID}: ${errorMessage}, ` + + `session version: ${sessionVersion}`, + ); } } } else if (message.type === peerToPeerMessageTypes.ENCRYPTED_MESSAGE) { @@ -314,6 +322,10 @@ 'Error decrypting message from device ' + `${message.senderInfo.deviceID}: ${errorMessage}`, ); + showAlertToStaff( + 'Error decrypting message from device ', + `${message.senderInfo.deviceID}: ${errorMessage}`, + ); if ( !errorMessage.includes(OLM_ERROR_FLAG) && @@ -431,6 +443,7 @@ identityClient, olmAPI, resendPeerToPeerMessages, + showAlertToStaff, sqliteAPI, ], );