element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.03k stars 1.96k forks source link

Element-R: backups are not flushed on logout #27267

Open richvdh opened 5 months ago

richvdh commented 5 months ago

Approximately every 10 seconds, we check to see if we have any room keys that need backing up to the server, and if so, we upload a batch.

This means that, when you log out, up to 10 seconds' worth of keys are lost. (This also happens when the app is closed, but it's hard to do much about that.)

On legacy crypto, we used to flush any pending backups in MatrixClient.logout. This doesn't happen for Rust crypto.

richvdh commented 4 months ago

This is maybe a bit of an edge-case, but it does also make testing particularly annoying because we end up adding ten-second sleeps. [We could maybe make the delay configurable, but we might as well instead fix this issue.]