Skip to content

Commit 56d80b9

Browse files
committed
fix(sdk): Send the crypto requests out before a sync as well
1 parent b0f48c9 commit 56d80b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/matrix-sdk/src/client.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,17 @@ impl Client {
18531853
&self,
18541854
sync_settings: crate::config::SyncSettings<'_>,
18551855
) -> Result<SyncResponse> {
1856+
// The sync might not return for quite a while due to the timeout.
1857+
// We'll see if there's anything crypto related to send out before we
1858+
// sync, i.e. if we closed our client after a sync but before the
1859+
// crypto requests were sent out.
1860+
//
1861+
// This will mostly be a no-op.
1862+
#[cfg(feature = "encryption")]
1863+
if let Err(e) = self.send_outgoing_requests().await {
1864+
error!(error =? e, "Error while sending outgoing E2EE requests");
1865+
};
1866+
18561867
let request = assign!(sync_events::Request::new(), {
18571868
filter: sync_settings.filter.as_ref(),
18581869
since: sync_settings.token.as_deref(),

0 commit comments

Comments
 (0)