diff --git a/lib/components/secondary-device-qr-auth-context-provider.react.js b/lib/components/secondary-device-qr-auth-context-provider.react.js --- a/lib/components/secondary-device-qr-auth-context-provider.react.js +++ b/lib/components/secondary-device-qr-auth-context-provider.react.js @@ -150,13 +150,25 @@ } void (async () => { - const message = await composeTunnelbrokerQRAuthMessage(qrData?.aesKey, { - type: qrCodeAuthMessageTypes.SECONDARY_DEVICE_REGISTRATION_SUCCESS, - }); - await sendMessageToDevice({ - deviceID: primaryDeviceID, - payload: JSON.stringify(message), - }); + try { + const message = await composeTunnelbrokerQRAuthMessage(qrData?.aesKey, { + type: qrCodeAuthMessageTypes.SECONDARY_DEVICE_REGISTRATION_SUCCESS, + }); + await sendMessageToDevice({ + deviceID: primaryDeviceID, + payload: JSON.stringify(message), + }); + } catch (e) { + // QR auth already succeeded at this point. If sending this message + // fails, primary device will timeout and display the "Device not + // responding" screen, but user can ignore it because the device + // is functional and working + const errorMessage = getMessageForException(e); + console.log( + 'Failed to send registration success message:', + errorMessage, + ); + } setQRAuthFinished(true); setQRData(null); })();