element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
Apache License 2.0
3.26k stars 676 forks source link

Message keys not migrated from legacy to Rust store are not backed up #8858

Open richvdh opened 1 week ago

richvdh commented 1 week ago
  1. Install Element Android 1.5.32 or older (any other version without crypto rust)
  2. Send some events in rooms to have a significant history. Do not set up key backup at this point.
  3. Upgrade to more recent version of Element Android
  4. Configure key backup
  5. Start a new session on a new client
  6. Note that keys that could be decrypted on EA are not decryptable on the new session

The problem is that keys that were in the legacy/Realm DB are not actively migrated to the Rust DB (they are copied lazily when the client needs them). So then, when backup is set up on the Rust client, those keys are not backed up, and the new session cannot access them.