diff options
author | Vika <vika@fireburn.ru> | 2022-05-10 21:08:44 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-05-10 21:08:44 +0300 |
commit | 34f1c6229bac92212c97cbacc77801d4a2921e4a (patch) | |
tree | ecf1fbd51cb914b83561bc84e1a88d1d6a6673e7 /src/database/mod.rs | |
parent | 2d59c07adc4cc46cd172e45e3f0ad989e9bede33 (diff) | |
download | kittybox-34f1c6229bac92212c97cbacc77801d4a2921e4a.tar.zst |
database, frontend: code cleanup so clippy doesn't complain
Diffstat (limited to 'src/database/mod.rs')
-rw-r--r-- | src/database/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs index b9a8652..6bf5409 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -209,11 +209,11 @@ pub trait Storage: std::fmt::Debug + Clone + Send + Sync { /// Modify a post using an update object as defined in the Micropub spec. /// - /// Note to implementors: the update operation MUST be atomic OR MUST lock the database - /// to prevent two clients overwriting each other's changes. - /// - /// You can assume concurrent updates will never contradict each other, since that will be dumb. - /// The last update always wins. + /// Note to implementors: the update operation MUST be atomic and + /// SHOULD lock the database to prevent two clients overwriting + /// each other's changes or simply corrupting something. Rejecting + /// is allowed in case of concurrent updates if waiting for a lock + /// cannot be done. async fn update_post(&self, url: &'_ str, update: serde_json::Value) -> Result<()>; /// Get a list of channels available for the user represented by the URL `user` to write to. @@ -323,6 +323,7 @@ mod tests { } /// Note: this is merely a smoke check and is in no way comprehensive. + // TODO updates for feeds must update children using special logic async fn test_update<Backend: Storage>(backend: Backend) { let post: serde_json::Value = json!({ "type": ["h-entry"], |