Skip to content

Commit fd2dc18

Browse files
committed
refactor(sdk): Retry event decryption in timeline item order
This works better for relations.
1 parent 55549f6 commit fd2dc18

File tree

1 file changed

+2
-2
lines changed
  • crates/matrix-sdk/src/room/timeline

1 file changed

+2
-2
lines changed

crates/matrix-sdk/src/room/timeline/inner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl<P: ProfileProvider> TimelineInner<P> {
352352
}
353353

354354
let mut metadata_lock = self.metadata.lock().await;
355-
for (idx, event_id, session_id, utd) in utds_for_session.iter().rev() {
355+
for (idx, event_id, session_id, utd) in utds_for_session {
356356
let event = match olm_machine.decrypt_room_event(utd.cast_ref(), room_id).await {
357357
Ok(ev) => ev,
358358
Err(e) => {
@@ -374,7 +374,7 @@ impl<P: ProfileProvider> TimelineInner<P> {
374374
handle_remote_event(
375375
event.event.cast(),
376376
event.encryption_info,
377-
TimelineItemPosition::Update(*idx),
377+
TimelineItemPosition::Update(idx),
378378
&self.items,
379379
&mut metadata_lock,
380380
&self.profile_provider,

0 commit comments

Comments
 (0)