From e00fa4352df18332b077017493346cecaa5c26be Mon Sep 17 00:00:00 2001 From: Timshel Date: Fri, 16 Oct 2026 16:36:39 +0200 Subject: [PATCH] Add lost-trust warning --- src/api/core/accounts.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index 76b7df78..449f3286 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -1606,10 +1606,19 @@ async fn get_all_devices(headers: Headers, conn: DbConn) -> JsonResult { }))) } +/// Reported by a client that still holds a device key but did not get any keys back from us. #[post("/devices/lost-trust")] async fn post_device_lost_trust(headers: Headers, conn: DbConn) -> EmptyResult { let mut device = headers.device; + warn!( + "Device {} ({}) of user {} still holds a device key, but has no trusted device keys on the server", + device.uuid, + DeviceType::from_i32(device.atype), + headers.user.uuid + ); + + // Still ensure that it's the case. if device.lost_trust() { device.save(true, &conn).await?; }