AO3-7258 Add over-reporting limit for specific collections#5920
Open
isabellemyz wants to merge 8 commits into
Open
AO3-7258 Add over-reporting limit for specific collections#5920isabellemyz wants to merge 8 commits into
isabellemyz wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7258
Purpose
Currently, there is no reporting limit for specific collections, so the same collection can be reported repeatedly without hitting a collection-specific limit.
This PR adds a collection-specific over-reporting check. A collection can now be reported up to
ArchiveConfig.ABUSE_REPORTS_PER_COLLECTION_MAXtimes withinArchiveConfig.ABUSE_REPORTS_PER_COLLECTION_PERIOD. As per the ticket, the default values are 3 reports per 30 days.When the limit is reached, users see the collection-specific error:
This collection has already been reported. Our volunteers only need one report in order to investigate and resolve an issue, so please be patient and do not submit another report.The implementation follows the existing abuse report URL-limit pattern. This pattern is already used for works, bookmarks, comments, series, and users.
Collection URLs are standardized before validation so equivalent URLs such as
/collections/COLLECTION_NAMEand/collections/COLLECTION_NAME?show_random=truecount towards the same collection. Reports for specific works within a collection, such as/collections/COLLECTION_NAME/works/####, are excluded from the collection count and continue to use the work-reporting limit instead.Testing Instructions
New tests for the behavior introduced in this PR have been added to
abuse_report_spec.rb.To run the new tests, use the following command:
docker compose run --rm test bundle exec rspec spec/models/abuse_report_spec.rb:346Manual testing can also be done to verify the PR changes. Manual testing instructions can be found in the ticket. You will have to increase the
ABUSE_REPORTS_PER_EMAIL_MAXvalue in order to successfully complete manual testing.References
In the Jira ticket for this issue, another ticket was linked as a related work item: https://otwarchive.atlassian.net/browse/AO3-7253
Credit
Name: Isabelle Zhang
Pronouns: she/her