diff --git a/server/lemmy_db/src/comment.rs b/server/lemmy_db/src/comment.rs index b2e22aa62..836e27a29 100644 --- a/server/lemmy_db/src/comment.rs +++ b/server/lemmy_db/src/comment.rs @@ -166,7 +166,8 @@ impl Comment { let existing = Self::read_from_apub_id(conn, &comment_form.ap_id); match existing { Err(NotFound {}) => Ok(Self::create(conn, &comment_form)?), - Ok(p) => Ok(Self::update(conn, p.id, &comment_form)?), + // both the old and new comment should be identical so no need to do an update here + Ok(p) => Ok(Self::read(conn, p.id)?), Err(e) => Err(e), } } diff --git a/server/lemmy_db/src/post.rs b/server/lemmy_db/src/post.rs index a6df50bff..499847d63 100644 --- a/server/lemmy_db/src/post.rs +++ b/server/lemmy_db/src/post.rs @@ -183,7 +183,8 @@ impl Post { let existing = Self::read_from_apub_id(conn, &post_form.ap_id); match existing { Err(NotFound {}) => Ok(Self::create(conn, &post_form)?), - Ok(p) => Ok(Self::update(conn, p.id, &post_form)?), + // both the old and new comment should be identical so no need to do an update here + Ok(p) => Ok(Self::read(conn, p.id)?), Err(e) => Err(e), } } diff --git a/server/src/main.rs b/server/src/main.rs index 456e92268..19b39ce4d 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -76,13 +76,22 @@ async fn main() -> Result<(), LemmyError> { ); let activity_queue = create_activity_queue(); - let chat_server = - ChatServer::startup(pool.clone(), rate_limiter.clone(), Client::default(), activity_queue.clone()).start(); + let chat_server = ChatServer::startup( + pool.clone(), + rate_limiter.clone(), + Client::default(), + activity_queue.clone(), + ) + .start(); // Create Http server with websocket support HttpServer::new(move || { - let context = - LemmyContext::create(pool.clone(), chat_server.to_owned(), Client::default(), activity_queue.to_owned()); + let context = LemmyContext::create( + pool.clone(), + chat_server.to_owned(), + Client::default(), + activity_queue.to_owned(), + ); let settings = Settings::get(); let rate_limiter = rate_limiter.clone(); App::new()