From db1d31c9cc60ea2fa2f759782951c5fa28d73235 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Mon, 9 Jan 2023 13:20:59 +0100 Subject: [PATCH] fix(sliding-sync): Do not implictly activate to-device extension upon unfreeze Previously, when we found a since-token in the frozen state, we'd always activate the to-device extensions regardless of whether the user had activated it in their builder or didn't. With this change we are only setting the since parameter from cache if the user actually activated the to-device extension. --- crates/matrix-sdk/src/sliding_sync.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/matrix-sdk/src/sliding_sync.rs b/crates/matrix-sdk/src/sliding_sync.rs index 0f526b118..e69249fb9 100644 --- a/crates/matrix-sdk/src/sliding_sync.rs +++ b/crates/matrix-sdk/src/sliding_sync.rs @@ -405,11 +405,11 @@ impl SlidingSyncConfig { .collect(); if let Some(since) = f.to_device_since { - extensions - .get_or_insert_with(Default::default) - .to_device - .get_or_insert_with(Default::default) - .since = Some(since); + if let Some(to_device_ext) = + extensions.get_or_insert_with(Default::default).to_device.as_mut() + { + to_device_ext.since = Some(since); + } } } };