diff --git a/crates/api_common/src/context.rs b/crates/api_common/src/context.rs index 8d8dc5013..25a1ec75d 100644 --- a/crates/api_common/src/context.rs +++ b/crates/api_common/src/context.rs @@ -92,6 +92,7 @@ impl LemmyContext { let config = FederationConfig::builder() .domain(context.settings().hostname.clone()) .app_data(context) + .http_fetch_limit(0) .build() .await .expect("build federation config"); diff --git a/crates/apub/assets/mastodon/objects/page.json b/crates/apub/assets/mastodon/objects/page.json index ec4c13080..2965b4b8d 100644 --- a/crates/apub/assets/mastodon/objects/page.json +++ b/crates/apub/assets/mastodon/objects/page.json @@ -11,21 +11,21 @@ "votersCount": "toot:votersCount" } ], - "id": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519", + "id": "https://masto.qa.urbanwildlife.biz/users/mastodon/statuses/110830743680706519", "type": "Note", "summary": null, "inReplyTo": null, "published": "2023-08-04T09:55:39Z", - "url": "https://dice.camp/@thekernelinyellow/110830743680706519", - "attributedTo": "https://dice.camp/users/thekernelinyellow", + "url": "https://masto.qa.urbanwildlife.biz/110830743680706519", + "attributedTo": "https://masto.qa.urbanwildlife.biz/users/mastodon", "to": ["https://www.w3.org/ns/activitystreams#Public"], "cc": [ - "https://dice.camp/users/thekernelinyellow/followers", + "https://masto.qa.urbanwildlife.biz/users/mastodon/followers", "https://enterprise.lemmy.ml/c/tenforward", "https://enterprise.lemmy.ml/c/tenforward/followers" ], "sensitive": false, - "atomUri": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519", + "atomUri": "https://masto.qa.urbanwildlife.biz/statuses/110830743680706519", "inReplyToAtomUri": null, "conversation": "tag:dice.camp,2023-08-04:objectId=29969291:objectType=Conversation", "content": "
@tenforward Variable never resetting at refresh
Hi! I'm using a variable to count elements in my generator but every time I generate a new character, the counter's value carries on from the previous one. Is there a function to reset it (I set it to 0 at the beginning of the file)
", @@ -41,12 +41,12 @@ } ], "replies": { - "id": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519/replies", + "id": "https://masto.qa.urbanwildlife.biz/users/mastodon/statuses/110830743680706519/replies", "type": "Collection", "first": { "type": "CollectionPage", - "next": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519/replies?only_other_accounts=true&page=true", - "partOf": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519/replies", + "next": "https://masto.qa.urbanwildlife.biz/users/mastodon/statuses/110830743680706519/replies?only_other_accounts=true&page=true", + "partOf": "https://masto.qa.urbanwildlife.biz/users/mastodon/statuses/110830743680706519/replies", "items": [] } } diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index 681fef2c4..0f4e1731c 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -293,8 +293,7 @@ mod tests { use super::*; use crate::{ objects::{ - community::{tests::parse_lemmy_community, ApubCommunity}, - instance::ApubSite, + community::tests::parse_lemmy_community, person::{tests::parse_lemmy_person, ApubPerson}, }, protocol::tests::file_to_json_object, @@ -324,7 +323,10 @@ mod tests { assert!(!post.featured_community); assert_eq!(context.request_count(), 0); - cleanup(&context, person, site, community, post).await?; + Post::delete(&mut context.pool(), post.id).await?; + Person::delete(&mut context.pool(), person.id).await?; + Community::delete(&mut context.pool(), community.id).await?; + Site::delete(&mut context.pool(), site.id).await?; Ok(()) } @@ -332,29 +334,19 @@ mod tests { #[serial] async fn test_convert_mastodon_post_title() -> LemmyResult<()> { let context = LemmyContext::init_test_context().await; - let (person, site) = parse_lemmy_person(&context).await?; let community = parse_lemmy_community(&context).await?; + let json = file_to_json_object("assets/mastodon/objects/person.json")?; + let person = ApubPerson::from_json(json, &context).await?; + let json = file_to_json_object("assets/mastodon/objects/page.json")?; let post = ApubPost::from_json(json, &context).await?; assert_eq!(post.name, "Variable never resetting at refresh"); - cleanup(&context, person, site, community, post).await?; - Ok(()) - } - - async fn cleanup( - context: &Data