From 624bd3796a0aac730b9aba52b9737b4f83d9f327 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 a42722666..0ce8472c0 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;