fix: better migration, force e2ee device key updates

This commit is contained in:
Timo Kösters 2021-08-25 17:40:10 +02:00 committed by Jonas Zohren
parent 33923ad6a7
commit a15ea4c156
2 changed files with 8 additions and 1 deletions

View file

@ -563,7 +563,8 @@ async fn sync_helper(
} }
// Save the state after this sync so we can send the correct state diff next sync // Save the state after this sync so we can send the correct state diff next sync
db.rooms.associate_token_shortstatehash(&room_id, next_batch, current_shortstatehash)?; db.rooms
.associate_token_shortstatehash(&room_id, next_batch, current_shortstatehash)?;
let joined_room = sync_events::JoinedRoom { let joined_room = sync_events::JoinedRoom {
account_data: sync_events::RoomAccountData { account_data: sync_events::RoomAccountData {

View file

@ -725,6 +725,12 @@ impl Database {
.insert(&shortstatekey, &statekey)?; .insert(&shortstatekey, &statekey)?;
} }
// Force E2EE device list updates so we can send them over federation
for user_id in db.users.iter().filter_map(|r| r.ok()) {
db.users
.mark_device_key_update(&user_id, &db.rooms, &db.globals)?;
}
db.globals.bump_database_version(10)?; db.globals.bump_database_version(10)?;
println!("Migration: 9 -> 10 finished"); println!("Migration: 9 -> 10 finished");