From 2443b3592b6df4b717966f165ef5007de2cc22c8 Mon Sep 17 00:00:00 2001 From: Vika Date: Sat, 22 Jul 2023 16:24:26 +0300 Subject: Fix a few bugs --- kittybox-rs/src/database/postgres/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'kittybox-rs/src/database/postgres/mod.rs') diff --git a/kittybox-rs/src/database/postgres/mod.rs b/kittybox-rs/src/database/postgres/mod.rs index b1a03b1..4477b9c 100644 --- a/kittybox-rs/src/database/postgres/mod.rs +++ b/kittybox-rs/src/database/postgres/mod.rs @@ -130,6 +130,7 @@ impl Storage for PostgresStorage { .map(|_| ()) } + #[tracing::instrument(skip(self))] async fn add_or_update_webmention(&self, target: &str, mention_type: MentionType, mention: serde_json::Value) -> Result<()> { let mut txn = self.db.begin().await?; @@ -142,13 +143,18 @@ impl Storage for PostgresStorage { "The specified post wasn't found in the database." ))?; + tracing::debug!("Loaded post for target {} with uid {}", target, uid); + let key: &'static str = match mention_type { - MentionType::Reply => "reply", + MentionType::Reply => "comment", MentionType::Like => "like", MentionType::Repost => "repost", MentionType::Bookmark => "bookmark", MentionType::Mention => "mention", }; + + tracing::debug!("Mention type -> key: {}", key); + let mention_uid = mention["properties"]["uid"][0].clone(); if let Some(values) = post["properties"][key].as_array_mut() { for value in values.iter_mut() { -- cgit 1.4.1