diff --git a/crates/api_crud/src/post/read.rs b/crates/api_crud/src/post/read.rs index 506b97299..54029c0cf 100644 --- a/crates/api_crud/src/post/read.rs +++ b/crates/api_crud/src/post/read.rs @@ -88,6 +88,7 @@ pub async fn get_post( let cross_posts = if let Some(url) = &post_view.post.url { let mut x_posts = PostQuery { url_search: Some(url.inner().as_str().into()), + local_user: local_user_view.as_ref(), ..Default::default() } .list(&local_site.site, &mut context.pool()) diff --git a/crates/db_schema/src/impls/comment.rs b/crates/db_schema/src/impls/comment.rs index 6cdb54e4a..0ffd53f86 100644 --- a/crates/db_schema/src/impls/comment.rs +++ b/crates/db_schema/src/impls/comment.rs @@ -118,8 +118,9 @@ impl Crud for Comment { type IdType = CommentId; /// This is unimplemented, use [[Comment::create]] - async fn create(_pool: &mut DbPool<'_>, _comment_form: &Self::InsertForm) -> Result { - unimplemented!(); + async fn create(pool: &mut DbPool<'_>, comment_form: &Self::InsertForm) -> Result { + debug_assert!(false); + Comment::create(pool, comment_form, None).await } async fn update( diff --git a/crates/federate/src/worker.rs b/crates/federate/src/worker.rs index 24fb983db..25c9278aa 100644 --- a/crates/federate/src/worker.rs +++ b/crates/federate/src/worker.rs @@ -167,6 +167,14 @@ impl InstanceWorker { latest_id }; if id >= latest_id { + if id > latest_id { + tracing::error!( + "{}: last successful id {} is higher than latest id {} in database (did the db get cleared?)", + self.instance.domain, + id.0, + latest_id.0 + ); + } // no more work to be done, wait before rechecking tokio::select! { () = sleep(*WORK_FINISHED_RECHECK_DELAY) => {}, diff --git a/crates/utils/src/utils/validation.rs b/crates/utils/src/utils/validation.rs index c07a129b4..8891411a5 100644 --- a/crates/utils/src/utils/validation.rs +++ b/crates/utils/src/utils/validation.rs @@ -11,8 +11,10 @@ static VALID_MATRIX_ID_REGEX: Lazy = Lazy::new(|| { }); // taken from https://en.wikipedia.org/wiki/UTM_parameters static CLEAN_URL_PARAMS_REGEX: Lazy = Lazy::new(|| { - Regex::new(r"^utm_source|utm_medium|utm_campaign|utm_term|utm_content|gclid|gclsrc|dclid|fbclid$") - .expect("compile regex") + Regex::new( + r"^(utm_source|utm_medium|utm_campaign|utm_term|utm_content|gclid|gclsrc|dclid|fbclid)=", + ) + .expect("compile regex") }); const ALLOWED_POST_URL_SCHEMES: [&str; 3] = ["http", "https", "magnet"]; @@ -256,12 +258,11 @@ pub fn build_and_check_regex(regex_str_opt: &Option<&str>) -> LemmyResult