From bef4fe50ce61d3533eb9f8ef77905473f71f820f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Wed, 25 Aug 2021 17:40:10 +0200 Subject: [PATCH] fix: better migration, force e2ee device key updates --- src/client_server/sync.rs | 3 ++- src/database.rs | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client_server/sync.rs b/src/client_server/sync.rs index 270a5f06..7ce3b5bd 100644 --- a/src/client_server/sync.rs +++ b/src/client_server/sync.rs @@ -563,7 +563,8 @@ async fn sync_helper( } // 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 { account_data: sync_events::RoomAccountData { diff --git a/src/database.rs b/src/database.rs index 193fcf25..a183f244 100644 --- a/src/database.rs +++ b/src/database.rs @@ -710,6 +710,12 @@ impl Database { .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)?; println!("Migration: 9 -> 10 finished");