Skip to main content

handle_new_backups

Function handle_new_backups 

Source
async fn handle_new_backups<'a>(
    transaction: &mut TransactedDb<'a>,
    user_id: &UserId,
    current_backup: &DbRoomKeysBackup,
    new_backups: BTreeMap<OwnedRoomId, RoomKeyBackup>,
) -> Result<(i64, u64), RoomKeysError>
Expand description

Handles newly uploaded backup(s) and upserts the new one if they match the rules of should_keep_new_backup.

Note that it will only upsert (and hence bump the etag) if there is new backup data to store.

Returns the backup’s etag and count fields, taken from the newly upserted one or the existing one.