Skip to content

Commit e4bf600

Browse files
committed
refactor: Remove the decryption logic from the timeline
1 parent a62fea4 commit e4bf600

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

crates/matrix-sdk-ui/src/timeline/controller/decryption_retry_task.rs

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -300,42 +300,43 @@ async fn decryption_task<P: RoomDataProvider, D: Decryptor>(
300300
) {
301301
debug!("Decryption task starting.");
302302

303-
while let Some(request) = receiver.recv().await {
304-
let should_retry = |session_id: &str| {
305-
if let Some(session_ids) = &request.session_ids {
306-
session_ids.contains(session_id)
307-
} else {
308-
true
309-
}
310-
};
311-
312-
// Find the indices of events that are in the supplied sessions, distinguishing
313-
// between UTDs which we need to decrypt, and already-decrypted events where we
314-
// only need to re-fetch encryption info.
315-
let mut state = state.write().await;
316-
let (retry_decryption_indices, retry_info_indices) =
317-
compute_event_indices_to_retry_decryption(&state.items, should_retry);
318-
319-
// Retry fetching encryption info for events that are already decrypted
320-
if !retry_info_indices.is_empty() {
321-
debug!("Retrying fetching encryption info");
322-
retry_fetch_encryption_info(&mut state, retry_info_indices, &room_data_provider).await;
323-
}
324-
325-
// Retry decrypting any unable-to-decrypt messages
326-
if !retry_decryption_indices.is_empty() {
327-
debug!("Retrying decryption");
328-
decrypt_by_index(
329-
&mut state,
330-
&request.settings,
331-
&room_data_provider,
332-
request.decryptor,
333-
should_retry,
334-
retry_decryption_indices,
335-
)
336-
.await
337-
}
338-
}
303+
// while let Some(request) = receiver.recv().await {
304+
// let should_retry = |session_id: &str| {
305+
// if let Some(session_ids) = &request.session_ids {
306+
// session_ids.contains(session_id)
307+
// } else {
308+
// true
309+
// }
310+
// };
311+
//
312+
// // Find the indices of events that are in the supplied sessions,
313+
// distinguishing // between UTDs which we need to decrypt, and
314+
// already-decrypted events where we // only need to re-fetch encryption
315+
// info. let mut state = state.write().await;
316+
// let (retry_decryption_indices, retry_info_indices) =
317+
// compute_event_indices_to_retry_decryption(&state.items,
318+
// should_retry);
319+
//
320+
// // Retry fetching encryption info for events that are already decrypted
321+
// if !retry_info_indices.is_empty() {
322+
// debug!("Retrying fetching encryption info");
323+
// retry_fetch_encryption_info(&mut state, retry_info_indices,
324+
// &room_data_provider).await; }
325+
//
326+
// // Retry decrypting any unable-to-decrypt messages
327+
// if !retry_decryption_indices.is_empty() {
328+
// debug!("Retrying decryption");
329+
// decrypt_by_index(
330+
// &mut state,
331+
// &request.settings,
332+
// &room_data_provider,
333+
// request.decryptor,
334+
// should_retry,
335+
// retry_decryption_indices,
336+
// )
337+
// .await
338+
// }
339+
// }
339340

340341
debug!("Decryption task stopping.");
341342
}

0 commit comments

Comments
 (0)