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

[CORL-3105] increase rate limit for flagging comments in API #4552

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

nick-funk
Copy link
Contributor

What does this PR do?

Adjust the rate limiting for createCommentFlag so it can execute twice as often for the same interval.

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

Changes the @rate(...) for createCommentFlag from @rate(seconds: 3) to @rate(max: 2, seconds: 3) which increases the max from a default of 1 to 2.

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

N/A

How do I test this PR?

  • ensure you do not have DISABLE_RATE_LIMITERS set to true in your env vars
  • find a comment in your database
  • get its id and latest revision's id
  • using the following mutation with an admin user bearer token, issue the mutation
mutation {
	createCommentFlag(input: {
		commentID: "<some-comment-id>",
		commentRevisionID: "<comments-latest-revision-id>",
		reason: COMMENT_REPORTED_OTHER,
		additionalDetails: "additional details",
		clientMutationId: "1"
	}) {
		comment {
			id
		}
	}
}
  • check that you can do 2 of these every 3 seconds, otherwise you get rate limited

Were any tests migrated to React Testing Library?

No

How do we deploy this PR?

No special considerations.

@nick-funk nick-funk requested a review from kabeaty February 22, 2024 00:43
@nick-funk nick-funk changed the title [CORL-3105] increase limit for flagging comments in API [CORL-3105] increase rate limit for flagging comments in API Feb 22, 2024
Copy link

netlify bot commented Feb 22, 2024

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit 8142a28
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/65d698b07907d80008a76014

@tessalt tessalt added this to the v8.8.1 milestone Mar 14, 2024
@tessalt tessalt added this pull request to the merge queue Mar 14, 2024
Merged via the queue into develop with commit ec46c3a Mar 14, 2024
6 checks passed
@tessalt tessalt deleted the fix/CORL-3105-reduce-flag-comment-rate-limiter branch March 14, 2024 14:44
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.

3 participants