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

Fixing bug where comment replies wouldn't be sent to blocked instances. #4595

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

dessalines
Copy link
Member

- Instance blocks should only affect communities, not comments.
- Fixes #4590
#[tracing::instrument(skip_all)]
async fn check_instance_block(
Copy link
Member Author

Choose a reason for hiding this comment

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

This was only run from the send_local_notifs function, which creates comment_replies, mentions, and emails, none of which need to be blocked in an InstanceBlock.

person.id,
parent_creator_id,
person.instance_id,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should instead be fixed by passing community.instance_id, so that all communities from that instance are ignored but not the users? Seems like that would be consistent with the way instance blocking works in general.

Copy link
Member Author

Choose a reason for hiding this comment

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

I spent a few minutes thinking about it, and I think you're right. Its the community instance_id that should be blocked.

@dessalines dessalines marked this pull request as draft April 5, 2024 17:12
- Also refactor send_local_notifs slightly, since it has to fetch the
  community now.
- Fixes #4590
@dessalines dessalines marked this pull request as ready for review April 5, 2024 17:22
@@ -91,16 +90,19 @@ pub async fn build_post_response(
#[tracing::instrument(skip_all)]
pub async fn send_local_notifs(
mentions: Vec<MentionData>,
comment: &Comment,
comment_id: CommentId,
Copy link
Member Author

@dessalines dessalines Apr 5, 2024

Choose a reason for hiding this comment

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

Rather than pre-fetch and provide the comment, post, and community, I realized it'd be faster to just have the comment_id as a param here, and below do a single CommentView fetch to get all the necessary info.

@dessalines dessalines requested a review from Nutomic April 5, 2024 17:25
@Nutomic Nutomic merged commit 8e54a4a into main Apr 8, 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.

[Bug]: Notifications not coming through from users on a (user) blocked instance
3 participants