From bf4c716c7f7313d2e67e066307f11878df169817 Mon Sep 17 00:00:00 2001 From: Ginger Date: Thu, 21 May 2026 11:43:35 -0400 Subject: [PATCH] fix: Don't panic on missing SSH --- src/api/client/sync/v3/joined.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/client/sync/v3/joined.rs b/src/api/client/sync/v3/joined.rs index b5f6ba21c..c7be80778 100644 --- a/src/api/client/sync/v3/joined.rs +++ b/src/api/client/sync/v3/joined.rs @@ -387,16 +387,17 @@ async fn fetch_shortstatehashes( .state_accessor .pdu_shortstatehash(&pdu_after_last_sync_end.event_id) .await - .expect("pdu should have a shortstatehash") + .map_err(|err| err!("Last sync end PDU has no shortstatehash: {err}")) }, | None => { // No events have been sent since the last sync, // so the state then is the same as the state now - current_shortstatehash + Ok(current_shortstatehash) }, } })) - .await; + .await + .transpose()?; Ok(ShortStateHashes { current_shortstatehash, @@ -470,7 +471,7 @@ async fn build_state_events( .state_accessor .pdu_shortstatehash(&pdu.event_id) .await - .expect("event should have shortstatehash") + .map_err(|err| err!("Timeline start has no shortstatehash: {err}"))? } else { // if the timeline is empty there can't possibly be any changes to the state return Ok(vec![]);