From 073c033ab8bc2aab6bac1cf73f9755ecdb37b568 Mon Sep 17 00:00:00 2001 From: Ginger Date: Tue, 26 May 2026 09:05:06 -0400 Subject: [PATCH] fix: Don't panic on missing SSH in sliding sync --- src/api/client/sync/v5.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/api/client/sync/v5.rs b/src/api/client/sync/v5.rs index d8c26dff1..aaa67bf50 100644 --- a/src/api/client/sync/v5.rs +++ b/src/api/client/sync/v5.rs @@ -868,16 +868,20 @@ where .ignore_err(); } - let (_, pdu_at_last_sync_end) = pdus_rev.next().await?; + let (count, pdu_at_last_sync_end) = pdus_rev.next().await?; - Some( - services - .rooms - .state_accessor - .pdu_shortstatehash(&pdu_at_last_sync_end.event_id) - .await - .expect("pdu should have a shortstatehash"), - ) + if matches!(count, PduCount::Backfilled(_)) { + None + } else { + Some( + services + .rooms + .state_accessor + .pdu_shortstatehash(&pdu_at_last_sync_end.event_id) + .await + .expect("pdu should have a shortstatehash"), + ) + } } .await;