refactor(base): Renamed StateStore::list_dependend_send_queue_events to load_dependent_send_queue_events

This commit is contained in:
Benjamin Bouvier
2024-10-25 18:24:01 +02:00
parent ee80291c41
commit 888f992df0
6 changed files with 15 additions and 15 deletions

View File

@@ -1369,7 +1369,7 @@ impl StateStoreIntegrationTests for DynStateStore {
self.save_send_queue_event(room_id, txn0.clone(), event0).await.unwrap();
// No dependents, to start with.
assert!(self.list_dependent_send_queue_events(room_id).await.unwrap().is_empty());
assert!(self.load_dependent_send_queue_events(room_id).await.unwrap().is_empty());
// Save a redaction for that event.
let child_txn = ChildTransactionId::new();
@@ -1383,7 +1383,7 @@ impl StateStoreIntegrationTests for DynStateStore {
.unwrap();
// It worked.
let dependents = self.list_dependent_send_queue_events(room_id).await.unwrap();
let dependents = self.load_dependent_send_queue_events(room_id).await.unwrap();
assert_eq!(dependents.len(), 1);
assert_eq!(dependents[0].parent_transaction_id, txn0);
assert_eq!(dependents[0].own_transaction_id, child_txn);
@@ -1397,7 +1397,7 @@ impl StateStoreIntegrationTests for DynStateStore {
assert_eq!(num_updated, 1);
// It worked.
let dependents = self.list_dependent_send_queue_events(room_id).await.unwrap();
let dependents = self.load_dependent_send_queue_events(room_id).await.unwrap();
assert_eq!(dependents.len(), 1);
assert_eq!(dependents[0].parent_transaction_id, txn0);
assert_eq!(dependents[0].own_transaction_id, child_txn);
@@ -1412,7 +1412,7 @@ impl StateStoreIntegrationTests for DynStateStore {
assert!(removed);
// It worked.
assert!(self.list_dependent_send_queue_events(room_id).await.unwrap().is_empty());
assert!(self.load_dependent_send_queue_events(room_id).await.unwrap().is_empty());
// Now, inserting a dependent event and removing the original send queue event
// will NOT remove the dependent event.
@@ -1430,7 +1430,7 @@ impl StateStoreIntegrationTests for DynStateStore {
)
.await
.unwrap();
assert_eq!(self.list_dependent_send_queue_events(room_id).await.unwrap().len(), 1);
assert_eq!(self.load_dependent_send_queue_events(room_id).await.unwrap().len(), 1);
self.save_dependent_send_queue_event(
room_id,
@@ -1445,14 +1445,14 @@ impl StateStoreIntegrationTests for DynStateStore {
)
.await
.unwrap();
assert_eq!(self.list_dependent_send_queue_events(room_id).await.unwrap().len(), 2);
assert_eq!(self.load_dependent_send_queue_events(room_id).await.unwrap().len(), 2);
// Remove event0 / txn0.
let removed = self.remove_send_queue_event(room_id, &txn0).await.unwrap();
assert!(removed);
// This has removed none of the dependent events.
let dependents = self.list_dependent_send_queue_events(room_id).await.unwrap();
let dependents = self.load_dependent_send_queue_events(room_id).await.unwrap();
assert_eq!(dependents.len(), 2);
}
}

View File

@@ -949,7 +949,7 @@ impl StateStore for MemoryStore {
///
/// This returns absolutely all the dependent send queue events, whether
/// they have an event id or not.
async fn list_dependent_send_queue_events(
async fn load_dependent_send_queue_events(
&self,
room: &RoomId,
) -> Result<Vec<DependentQueuedEvent>, Self::Error> {

View File

@@ -439,7 +439,7 @@ pub trait StateStore: AsyncTraitDeps {
///
/// This returns absolutely all the dependent send queue events, whether
/// they have an event id or not. They must be returned in insertion order.
async fn list_dependent_send_queue_events(
async fn load_dependent_send_queue_events(
&self,
room: &RoomId,
) -> Result<Vec<DependentQueuedEvent>, Self::Error>;
@@ -710,11 +710,11 @@ impl<T: StateStore> StateStore for EraseStateStoreError<T> {
self.0.remove_dependent_send_queue_event(room_id, own_txn_id).await.map_err(Into::into)
}
async fn list_dependent_send_queue_events(
async fn load_dependent_send_queue_events(
&self,
room_id: &RoomId,
) -> Result<Vec<DependentQueuedEvent>, Self::Error> {
self.0.list_dependent_send_queue_events(room_id).await.map_err(Into::into)
self.0.load_dependent_send_queue_events(room_id).await.map_err(Into::into)
}
}

View File

@@ -1618,7 +1618,7 @@ impl_state_store!({
Ok(false)
}
async fn list_dependent_send_queue_events(
async fn load_dependent_send_queue_events(
&self,
room_id: &RoomId,
) -> Result<Vec<DependentQueuedEvent>> {

View File

@@ -1896,7 +1896,7 @@ impl StateStore for SqliteStateStore {
Ok(num_deleted > 0)
}
async fn list_dependent_send_queue_events(
async fn load_dependent_send_queue_events(
&self,
room_id: &RoomId,
) -> Result<Vec<DependentQueuedEvent>> {

View File

@@ -893,7 +893,7 @@ impl QueueStorage {
});
let local_reactions = store
.list_dependent_send_queue_events(&self.room_id)
.load_dependent_send_queue_events(&self.room_id)
.await?
.into_iter()
.filter_map(|dep| match dep.kind {
@@ -1078,7 +1078,7 @@ impl QueueStorage {
let store = client.store();
let dependent_events = store
.list_dependent_send_queue_events(&self.room_id)
.load_dependent_send_queue_events(&self.room_id)
.await
.map_err(RoomSendQueueStorageError::StorageError)?;