element-hq / element-ios

A glossy Matrix collaboration client for iOS
https://element.io
Apache License 2.0
1.72k stars 479 forks source link

"Unexpectedly found nil while implicitly unwrapping an Optional value" in MXKeyVerificationManagerV2.init() #7687

Closed hughns closed 9 months ago

hughns commented 9 months ago

This is happening on iOS develop branch.

Steps to reproduce

  1. Sign in to a homeserver using the QR function
  2. Logout
  3. Attempt to sign in again to the same homeserver using QR
  4. App crashes

If you try again the same happens. You need to delete the app to allow another sign in with QR.

The issue doesn't affect password signins on the same account on the same homeserver. So, it appears to be something in the way the QRLoginService is completing the sign in + verification steps.

Sample log extract:

2023-09-29 15:43:24.711573+0100 Element[1428:483451] [MXCryptoMachine] init(userId:deviceId:restClient:getRoomAction:): Initialized the crypto machine for @hugh:synapse-msc3882.rendezvous.lab.element.dev
  - device id  : FQIJUMSSBO
  - ed25519    : /4Kv90KuuTPr6+KPM+krb2U0/1HtcC5BbnYGPCHNZ78
  - curve25519 : 4OO8c/mGGGEC/pyZG01mXdX4YeFc9S/6c58g67Ig9UI
MatrixSDK/MXKeyVerificationManagerV2.swift:57: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value