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: Don't error out on deleted users #149

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

Drenmi
Copy link
Contributor

@Drenmi Drenmi commented Jun 17, 2024

What is the problem?

The GuardianExtension#poster_group_allow_translate? method restricts and determines whether a post can be translated based on the poster's group membership. There are reports that this errors out when deleting spammers.

The problem is that when a spammer is deleted, their post user_id is nullified, and because the above method doesn't account for this case, we try to call #in_any_groups? on nil, which errors out.

This PR fixes that by explicitly accounting for the case of a post with a nil user ID.


We have to make a decision here, since we're losing the history of which groups the poster was in, whether the post should be translatable or not. I'm defaulting to false here. It should be a minor thing as deleting a spam user should hide or delete their post as well.

@Drenmi Drenmi force-pushed the fix/fix-error-on-deleted-user branch from 8c894ba to 8d2c232 Compare June 17, 2024 03:06
@Drenmi Drenmi merged commit 17bd836 into main Jun 18, 2024
3 checks passed
@Drenmi Drenmi deleted the fix/fix-error-on-deleted-user branch June 18, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants