@@ -69,7 +69,7 @@ async fn test_event_cache_receives_events() {
69
69
70
70
// If I create a room event subscriber,
71
71
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
72
- let ( events, mut subscriber) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
72
+ let ( events, mut subscriber) = room_event_cache. subscribe ( ) . await ;
73
73
74
74
// Then at first it's empty, and the subscriber doesn't yield anything.
75
75
assert ! ( events. is_empty( ) ) ;
@@ -143,7 +143,7 @@ async fn test_ignored_unignored() {
143
143
// And subscribe to the room,
144
144
let room = client. get_room ( room_id) . unwrap ( ) ;
145
145
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
146
- let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
146
+ let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await ;
147
147
148
148
// Then at first it contains the two initial events.
149
149
assert_eq ! ( events. len( ) , 2 ) ;
@@ -201,7 +201,7 @@ async fn test_ignored_unignored() {
201
201
{
202
202
let room = client. get_room ( other_room_id) . unwrap ( ) ;
203
203
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
204
- let ( events, _) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
204
+ let ( events, _) = room_event_cache. subscribe ( ) . await ;
205
205
assert ! ( events. is_empty( ) ) ;
206
206
}
207
207
@@ -256,7 +256,7 @@ async fn test_backpaginate_once() {
256
256
257
257
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
258
258
259
- let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
259
+ let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await ;
260
260
261
261
// This is racy: either the initial message has been processed by the event
262
262
// cache (and no room updates will happen in this case), or it hasn't, and
@@ -341,7 +341,7 @@ async fn test_backpaginate_many_times_with_many_iterations() {
341
341
342
342
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
343
343
344
- let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
344
+ let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await ;
345
345
346
346
// This is racy: either the initial message has been processed by the event
347
347
// cache (and no room updates will happen in this case), or it hasn't, and
@@ -437,7 +437,7 @@ async fn test_backpaginate_many_times_with_many_iterations() {
437
437
assert ! ( room_stream. is_empty( ) ) ;
438
438
439
439
// And next time I'll open the room, I'll get the events in the right order.
440
- let ( events, room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
440
+ let ( events, room_stream) = room_event_cache. subscribe ( ) . await ;
441
441
442
442
assert_event_matches_msg ( & events[ 0 ] , "oh well" ) ;
443
443
assert_event_matches_msg ( & events[ 1 ] , "hello" ) ;
@@ -479,7 +479,7 @@ async fn test_backpaginate_many_times_with_one_iteration() {
479
479
let ( room_event_cache, _drop_handles) =
480
480
client. get_room ( room_id) . unwrap ( ) . event_cache ( ) . await . unwrap ( ) ;
481
481
482
- let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
482
+ let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await ;
483
483
484
484
// This is racy: either the initial message has been processed by the event
485
485
// cache (and no room updates will happen in this case), or it hasn't, and
@@ -577,7 +577,7 @@ async fn test_backpaginate_many_times_with_one_iteration() {
577
577
} ) ;
578
578
579
579
// And next time I'll open the room, I'll get the events in the right order.
580
- let ( events, room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
580
+ let ( events, room_stream) = room_event_cache. subscribe ( ) . await ;
581
581
582
582
assert_event_matches_msg ( & events[ 0 ] , "oh well" ) ;
583
583
assert_event_matches_msg ( & events[ 1 ] , "hello" ) ;
@@ -619,7 +619,7 @@ async fn test_reset_while_backpaginating() {
619
619
let ( room_event_cache, _drop_handles) =
620
620
client. get_room ( room_id) . unwrap ( ) . event_cache ( ) . await . unwrap ( ) ;
621
621
622
- let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
622
+ let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await ;
623
623
624
624
wait_for_initial_events ( events, & mut room_stream) . await ;
625
625
@@ -763,7 +763,7 @@ async fn test_backpaginating_without_token() {
763
763
let room = server. sync_joined_room ( & client, room_id) . await ;
764
764
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
765
765
766
- let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
766
+ let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await ;
767
767
768
768
assert ! ( events. is_empty( ) ) ;
769
769
assert ! ( room_stream. is_empty( ) ) ;
@@ -821,7 +821,7 @@ async fn test_limited_timeline_resets_pagination() {
821
821
822
822
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
823
823
824
- let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
824
+ let ( events, mut room_stream) = room_event_cache. subscribe ( ) . await ;
825
825
826
826
assert ! ( events. is_empty( ) ) ;
827
827
assert ! ( room_stream. is_empty( ) ) ;
@@ -908,7 +908,7 @@ async fn test_limited_timeline_with_storage() {
908
908
)
909
909
. await ;
910
910
911
- let ( initial_events, mut subscriber) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
911
+ let ( initial_events, mut subscriber) = room_event_cache. subscribe ( ) . await ;
912
912
913
913
// This is racy: either the sync has been handled, or it hasn't yet.
914
914
if initial_events. is_empty ( ) {
@@ -980,7 +980,7 @@ async fn test_limited_timeline_without_storage() {
980
980
)
981
981
. await ;
982
982
983
- let ( initial_events, mut subscriber) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
983
+ let ( initial_events, mut subscriber) = room_event_cache. subscribe ( ) . await ;
984
984
985
985
// This is racy: either the sync has been handled, or it hasn't yet.
986
986
if initial_events. is_empty ( ) {
@@ -1115,7 +1115,7 @@ async fn test_backpaginate_with_no_initial_events() {
1115
1115
pagination. run_backwards ( 20 , once) . await . unwrap ( ) ;
1116
1116
1117
1117
// The linked chunk should contain the events in the correct order.
1118
- let ( events, _stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1118
+ let ( events, _stream) = room_event_cache. subscribe ( ) . await ;
1119
1119
1120
1120
assert_eq ! ( events. len( ) , 3 , "{events:?}" ) ;
1121
1121
assert_event_matches_msg ( & events[ 0 ] , "oh well" ) ;
@@ -1150,7 +1150,7 @@ async fn test_backpaginate_replace_empty_gap() {
1150
1150
1151
1151
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
1152
1152
1153
- let ( events, mut stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1153
+ let ( events, mut stream) = room_event_cache. subscribe ( ) . await ;
1154
1154
wait_for_initial_events ( events, & mut stream) . await ;
1155
1155
1156
1156
// The first back-pagination will return a previous-batch token, but no events.
@@ -1178,7 +1178,7 @@ async fn test_backpaginate_replace_empty_gap() {
1178
1178
pagination. run_backwards ( 20 , once) . await . unwrap ( ) ;
1179
1179
1180
1180
// The linked chunk should contain the events in the correct order.
1181
- let ( events, _stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1181
+ let ( events, _stream) = room_event_cache. subscribe ( ) . await ;
1182
1182
1183
1183
assert_event_matches_msg ( & events[ 0 ] , "hello" ) ;
1184
1184
assert_event_matches_msg ( & events[ 1 ] , "world" ) ;
@@ -1219,7 +1219,7 @@ async fn test_no_gap_stored_after_deduplicated_sync() {
1219
1219
1220
1220
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
1221
1221
1222
- let ( events, mut stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1222
+ let ( events, mut stream) = room_event_cache. subscribe ( ) . await ;
1223
1223
1224
1224
if events. is_empty ( ) {
1225
1225
assert_let_timeout ! ( Ok ( RoomEventCacheUpdate :: UpdateTimelineEvents { .. } ) = stream. recv( ) ) ;
@@ -1259,7 +1259,7 @@ async fn test_no_gap_stored_after_deduplicated_sync() {
1259
1259
let outcome = pagination. run_backwards ( 20 , once) . await . unwrap ( ) ;
1260
1260
assert ! ( outcome. reached_start) ;
1261
1261
1262
- let ( events, stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1262
+ let ( events, stream) = room_event_cache. subscribe ( ) . await ;
1263
1263
assert_event_matches_msg ( & events[ 0 ] , "hello" ) ;
1264
1264
assert_event_matches_msg ( & events[ 1 ] , "world" ) ;
1265
1265
assert_event_matches_msg ( & events[ 2 ] , "sup" ) ;
@@ -1296,7 +1296,7 @@ async fn test_no_gap_stored_after_deduplicated_backpagination() {
1296
1296
1297
1297
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
1298
1298
1299
- let ( events, mut stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1299
+ let ( events, mut stream) = room_event_cache. subscribe ( ) . await ;
1300
1300
1301
1301
if events. is_empty ( ) {
1302
1302
assert_let_timeout ! ( Ok ( RoomEventCacheUpdate :: UpdateTimelineEvents { .. } ) = stream. recv( ) ) ;
@@ -1391,7 +1391,7 @@ async fn test_no_gap_stored_after_deduplicated_backpagination() {
1391
1391
assert ! ( outcome. events. is_empty( ) ) ;
1392
1392
assert ! ( stream. is_empty( ) ) ;
1393
1393
1394
- let ( events, stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1394
+ let ( events, stream) = room_event_cache. subscribe ( ) . await ;
1395
1395
assert_event_matches_msg ( & events[ 0 ] , "hello" ) ;
1396
1396
assert_event_matches_msg ( & events[ 1 ] , "world" ) ;
1397
1397
assert_event_matches_msg ( & events[ 2 ] , "sup" ) ;
@@ -1428,7 +1428,7 @@ async fn test_dont_delete_gap_that_wasnt_inserted() {
1428
1428
1429
1429
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
1430
1430
1431
- let ( events, mut stream) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1431
+ let ( events, mut stream) = room_event_cache. subscribe ( ) . await ;
1432
1432
if events. is_empty ( ) {
1433
1433
assert_let_timeout ! ( Ok ( RoomEventCacheUpdate :: UpdateTimelineEvents { .. } ) = stream. recv( ) ) ;
1434
1434
}
@@ -1492,7 +1492,7 @@ async fn test_apply_redaction_when_redaction_comes_later() {
1492
1492
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
1493
1493
1494
1494
// Wait for the first event.
1495
- let ( events, mut subscriber) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1495
+ let ( events, mut subscriber) = room_event_cache. subscribe ( ) . await ;
1496
1496
if events. is_empty ( ) {
1497
1497
assert_let_timeout ! (
1498
1498
Ok ( RoomEventCacheUpdate :: UpdateTimelineEvents { .. } ) = subscriber. recv( )
@@ -1554,7 +1554,7 @@ async fn test_apply_redaction_when_redacted_and_redaction_are_in_same_sync() {
1554
1554
let room_id = room_id ! ( "!omelette:fromage.fr" ) ;
1555
1555
let room = server. sync_joined_room ( & client, room_id) . await ;
1556
1556
let ( room_event_cache, _drop_handles) = room. event_cache ( ) . await . unwrap ( ) ;
1557
- let ( _events, mut subscriber) = room_event_cache. subscribe ( ) . await . unwrap ( ) ;
1557
+ let ( _events, mut subscriber) = room_event_cache. subscribe ( ) . await ;
1558
1558
1559
1559
let f = EventFactory :: new ( ) . room ( room_id) . sender ( user_id ! ( "@a:b.c" ) ) ;
1560
1560
0 commit comments