refactor!(base): rename StateStore::update_dependent_queued_request to mark_dependent_queued_requests_as_ready

This commit is contained in:
Benjamin Bouvier
2024-11-18 14:14:43 +01:00
parent c4ff07124b
commit fa47af3dd6
6 changed files with 12 additions and 10 deletions

View File

@@ -1478,7 +1478,7 @@ impl StateStoreIntegrationTests for DynStateStore {
// Update the event id.
let event_id = owned_event_id!("$1");
let num_updated = self
.update_dependent_queued_request(
.mark_dependent_queued_requests_as_ready(
room_id,
&txn0,
SentRequestKey::Event(event_id.clone()),

View File

@@ -917,7 +917,7 @@ impl StateStore for MemoryStore {
Ok(())
}
async fn update_dependent_queued_request(
async fn mark_dependent_queued_requests_as_ready(
&self,
room: &RoomId,
parent_txn_id: &TransactionId,

View File

@@ -424,15 +424,15 @@ pub trait StateStore: AsyncTraitDeps {
content: DependentQueuedRequestKind,
) -> Result<(), Self::Error>;
/// Update a set of dependent send queue requests with a key identifying the
/// homeserver's response, effectively marking them as ready.
/// Mark a set of dependent send queue requests as ready, using a key
/// identifying the homeserver's response.
///
/// ⚠ Beware! There's no verification applied that the parent key type is
/// compatible with the dependent event type. The invalid state may be
/// lazily filtered out in `load_dependent_queued_requests`.
///
/// Returns the number of updated requests.
async fn update_dependent_queued_request(
async fn mark_dependent_queued_requests_as_ready(
&self,
room_id: &RoomId,
parent_txn_id: &TransactionId,
@@ -709,14 +709,14 @@ impl<T: StateStore> StateStore for EraseStateStoreError<T> {
.map_err(Into::into)
}
async fn update_dependent_queued_request(
async fn mark_dependent_queued_requests_as_ready(
&self,
room_id: &RoomId,
parent_txn_id: &TransactionId,
sent_parent_key: SentRequestKey,
) -> Result<usize, Self::Error> {
self.0
.update_dependent_queued_request(room_id, parent_txn_id, sent_parent_key)
.mark_dependent_queued_requests_as_ready(room_id, parent_txn_id, sent_parent_key)
.await
.map_err(Into::into)
}

View File

@@ -1594,7 +1594,7 @@ impl_state_store!({
Ok(())
}
async fn update_dependent_queued_request(
async fn mark_dependent_queued_requests_as_ready(
&self,
room_id: &RoomId,
parent_txn_id: &TransactionId,

View File

@@ -1924,7 +1924,7 @@ impl StateStore for SqliteStateStore {
.await
}
async fn update_dependent_queued_request(
async fn mark_dependent_queued_requests_as_ready(
&self,
room_id: &RoomId,
parent_txn_id: &TransactionId,

View File

@@ -1077,7 +1077,9 @@ impl QueueStorage {
let store = client.store();
// Update all dependent requests.
store.update_dependent_queued_request(&self.room_id, transaction_id, parent_key).await?;
store
.mark_dependent_queued_requests_as_ready(&self.room_id, transaction_id, parent_key)
.await?;
let removed = store.remove_send_queue_request(&self.room_id, transaction_id).await?;