perf: Don't increment the device list version when updating local info

This commit is contained in:
timedout
2025-12-02 14:19:27 +00:00
parent f3115e14ab
commit ba55dffa0e
8 changed files with 34 additions and 20 deletions
+3 -3
View File
@@ -40,11 +40,11 @@ pub(crate) async fn send_state_event_for_key_route(
.users
.get_device_metadata(sender_user, device_id)
.await
.or_else(|_| err!(Request(NotFound("device {device_id} not found?"))))?;
.expect("Device metadata should exist for authenticated device");
device.last_seen_ts = Some(MilliSecondsSinceUnixEpoch::now());
services
.users
.update_device_metadata(sender_user, device_id, &device)
.update_device_last_seen(sender_user, device_id, &device)
.await?;
}
@@ -199,7 +199,7 @@ async fn send_state_event_for_key_helper(
event_type: &StateEventType,
json: &Raw<AnyStateEventContent>,
state_key: &str,
timestamp: Option<ruma::MilliSecondsSinceUnixEpoch>,
timestamp: Option<MilliSecondsSinceUnixEpoch>,
) -> Result<OwnedEventId> {
allowed_to_send_state_event(services, room_id, event_type, state_key, json).await?;
let state_lock = services.rooms.state.mutex.lock(room_id).await;