Skip to content

AO3-7258 Add over-reporting limit for specific collections#5920

Open
isabellemyz wants to merge 8 commits into
otwcode:masterfrom
isabellemyz:AO3-7258
Open

AO3-7258 Add over-reporting limit for specific collections#5920
isabellemyz wants to merge 8 commits into
otwcode:masterfrom
isabellemyz:AO3-7258

Conversation

@isabellemyz

@isabellemyz isabellemyz commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

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_MAX times within ArchiveConfig.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_NAME and /collections/COLLECTION_NAME?show_random=true count 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:346

Manual 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_MAX value 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant