File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
crates/matrix-sdk-indexeddb/src/event_cache_store Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -755,6 +755,13 @@ macro_rules! event_cache_store_integration_tests {
755
755
get_event_cache_store( ) . await . unwrap( ) . into_event_cache_store( ) ;
756
756
event_cache_store. test_filter_duplicated_events( ) . await ;
757
757
}
758
+
759
+ #[ async_test]
760
+ async fn test_find_event( ) {
761
+ let event_cache_store =
762
+ get_event_cache_store( ) . await . unwrap( ) . into_event_cache_store( ) ;
763
+ event_cache_store. test_find_event( ) . await ;
764
+ }
758
765
}
759
766
} ;
760
767
}
Original file line number Diff line number Diff line change @@ -462,10 +462,14 @@ impl_event_cache_store! {
462
462
event_id: & EventId ,
463
463
) -> Result <Option <Event >, IndexeddbEventCacheStoreError > {
464
464
let _timer = timer!( "method" ) ;
465
- self . memory_store
466
- . find_event( room_id, event_id)
465
+
466
+ let transaction =
467
+ self . transaction( & [ keys:: EVENTS ] , IdbTransactionMode :: Readonly ) ?;
468
+ transaction
469
+ . get_event_by_id( room_id, & event_id. to_owned( ) )
467
470
. await
468
- . map_err( IndexeddbEventCacheStoreError :: MemoryStore )
471
+ . map( |ok| ok. map( Into :: into) )
472
+ . map_err( Into :: into)
469
473
}
470
474
471
475
#[ instrument( skip( self , event_id, filters) ) ]
You can’t perform that action at this time.
0 commit comments