File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
crates/matrix-sdk-indexeddb/src/event_cache_store Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -260,10 +260,25 @@ impl_event_cache_store! {
260
260
& self ,
261
261
linked_chunk_id: LinkedChunkId <' _>,
262
262
) -> Result <Vec <RawChunk <Event , Gap >>, IndexeddbEventCacheStoreError > {
263
- self . memory_store
264
- . load_all_chunks( linked_chunk_id)
265
- . await
266
- . map_err( IndexeddbEventCacheStoreError :: MemoryStore )
263
+ let linked_chunk_id = linked_chunk_id. to_owned( ) ;
264
+ let room_id = linked_chunk_id. room_id( ) ;
265
+
266
+ let transaction = self . transaction(
267
+ & [ keys:: LINKED_CHUNKS , keys:: GAPS , keys:: EVENTS ] ,
268
+ IdbTransactionMode :: Readwrite ,
269
+ ) ?;
270
+
271
+ let mut raw_chunks = Vec :: new( ) ;
272
+ let chunks = transaction. get_chunks_in_room( room_id) . await ?;
273
+ for chunk in chunks {
274
+ if let Some ( raw_chunk) = transaction
275
+ . load_chunk_by_id( room_id, & ChunkIdentifier :: new( chunk. identifier) )
276
+ . await ?
277
+ {
278
+ raw_chunks. push( raw_chunk) ;
279
+ }
280
+ }
281
+ Ok ( raw_chunks)
267
282
}
268
283
269
284
async fn load_all_chunks_metadata(
You can’t perform that action at this time.
0 commit comments