From cc61e123b740052fa58e045b4c206aa4f069c032 Mon Sep 17 00:00:00 2001 From: Michael Goldenberg Date: Sun, 17 Aug 2025 11:58:55 -0400 Subject: [PATCH] docs(indexeddb): remove references to room where relevant in transaction docs Signed-off-by: Michael Goldenberg --- .../src/event_cache_store/transaction.rs | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/crates/matrix-sdk-indexeddb/src/event_cache_store/transaction.rs b/crates/matrix-sdk-indexeddb/src/event_cache_store/transaction.rs index 0703bf19f..760fb95fe 100644 --- a/crates/matrix-sdk-indexeddb/src/event_cache_store/transaction.rs +++ b/crates/matrix-sdk-indexeddb/src/event_cache_store/transaction.rs @@ -104,8 +104,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { self.transaction.await.into_result().map_err(Into::into) } - /// Query IndexedDB for items that match the given key range in the given - /// room. + /// Query IndexedDB for items that match the given key range pub async fn get_items_by_key( &self, range: impl Into>, @@ -133,8 +132,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { Ok(items) } - /// Query IndexedDB for items that match the given key component range in - /// the given room. + /// Query IndexedDB for items that match the given key component range pub async fn get_items_by_key_components<'b, T, K>( &self, range: impl Into>>, @@ -168,7 +166,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { .await } - /// Query IndexedDB for all items in the given room by key `K` + /// Query IndexedDB for all items of type `T` by key `K` in the given room pub async fn get_items_in_room<'b, T, K>( &self, room_id: &'b RoomId, @@ -186,7 +184,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { .await } - /// Query IndexedDB for items that match the given key in the given room. If + /// Query IndexedDB for items that match the given key. If /// more than one item is found, an error is returned. pub async fn get_item_by_key( &self, @@ -205,8 +203,8 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { Ok(items.pop()) } - /// Query IndexedDB for items that match the given key components in the - /// given room. If more than one item is found, an error is returned. + /// Query IndexedDB for items that match the given key components. If more + /// than one item is found, an error is returned. pub async fn get_item_by_key_components<'b, T, K>( &self, components: K::KeyComponents<'b>, @@ -224,8 +222,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { Ok(items.pop()) } - /// Query IndexedDB for the number of items that match the given key range - /// in the given room. + /// Query IndexedDB for the number of items that match the given key range. pub async fn get_items_count_by_key( &self, range: impl Into>, @@ -247,7 +244,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { } /// Query IndexedDB for the number of items that match the given key - /// components range in the given room. + /// components range. pub async fn get_items_count_by_key_components<'b, T, K>( &self, range: impl Into>>, @@ -281,7 +278,8 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { .await } - /// Query IndexedDB for the number of items in the given room. + /// Query IndexedDB for the number of items of type `T` by `K` in the given + /// room. pub async fn get_items_count_in_room<'b, T, K>( &self, room_id: &'b RoomId, @@ -331,7 +329,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { } } - /// Adds an item to the given room in the corresponding IndexedDB object + /// Adds an item to the corresponding IndexedDB object /// store, i.e., `T::OBJECT_STORE`. If an item with the same key already /// exists, it will be rejected. pub async fn add_item( @@ -352,7 +350,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { .map_err(Into::into) } - /// Puts an item in the given room in the corresponding IndexedDB object + /// Puts an item in the corresponding IndexedDB object /// store, i.e., `T::OBJECT_STORE`. If an item with the same key already /// exists, it will be overwritten. pub async fn put_item( @@ -373,7 +371,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { .map_err(Into::into) } - /// Delete items in given key range in the given room from IndexedDB + /// Delete items in given key range from IndexedDB pub async fn delete_items_by_key( &self, range: impl Into>, @@ -398,7 +396,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { Ok(()) } - /// Delete items in the given key component range in the given room from + /// Delete items in the given key component range from /// IndexedDB pub async fn delete_items_by_key_components<'b, T, K>( &self, @@ -445,7 +443,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { .await } - /// Delete item that matches the given key components in the given room from + /// Delete item that matches the given key components from /// IndexedDB pub async fn delete_item_by_key<'b, T, K>( &self, @@ -458,7 +456,8 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { self.delete_items_by_key_components::(key).await } - /// Clear all items of type `T` in all rooms from IndexedDB + /// Clear all items of type `T` from the associated object store + /// `T::OBJECT_STORE` from IndexedDB pub async fn clear(&self) -> Result<(), IndexeddbEventCacheStoreTransactionError> where T: Indexed, @@ -651,7 +650,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { Ok(()) } - /// Delete all chunks in the given room + /// Delete all chunks associated with the given linked chunk id pub async fn delete_chunks_by_linked_chunk_id( &self, linked_chunk_id: LinkedChunkId<'_>, @@ -757,7 +756,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> { self.get_items_by_key::(range).await } - /// Puts an event in the given room. If an event with the same key already + /// Puts an event in IndexedDB. If an event with the same key already /// exists, it will be overwritten. pub async fn put_event( &self,