about summary refs log tree commit diff
path: root/src/database/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/mod.rs')
-rw-r--r--src/database/mod.rs11
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"],