Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix communities with broken outboxes, and use PostView. Fixes #4658 #4668

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

dessalines
Copy link
Member

Rather than looping over Person::read, which may include a deleted person which throws an error, use the PostView.

@@ -38,7 +38,7 @@ use url::Url;

impl CreateOrUpdatePage {
pub(crate) async fn new(
post: ApubPost,
post: &ApubPost,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a good place for an Rc/Cow.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rc/clone is not enough to avoid cloning in this case because into_json only works on plain ApubPost.

I think this shouldn't be changed to &ApubPost because it's better and more normal for the caller to decide whether or not to clone.

https://rust-lang.github.io/api-guidelines/flexibility.html#caller-decides-where-to-copy-and-place-data-c-caller-control

@Nutomic Nutomic merged commit 492d8f1 into main Apr 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants