Skip to content

Commit

Permalink
fixup! feat(base): add a way to update a dependent send queue request
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjbvr committed Nov 19, 2024
1 parent 67bbac5 commit e3d88db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/matrix-sdk-sqlite/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ pub enum Error {

#[error("Redaction failed: {0}")]
Redaction(#[source] ruma::canonical_json::RedactionError),

#[error("An update keyed by unique ID touched more than one entry")]
InconsistentUpdate,
}

macro_rules! impl_from {
Expand Down
4 changes: 4 additions & 0 deletions crates/matrix-sdk-sqlite/src/state_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1899,6 +1899,10 @@ impl StateStore for SqliteStateStore {
})
.await?;

if num_updated > 1 {
return Err(Error::InconsistentUpdate);
}

Ok(num_updated == 1)
}

Expand Down

0 comments on commit e3d88db

Please sign in to comment.