Page MenuHomePhabricator

Enforce edit rate limits when editing lexeme
Closed, ResolvedPublic3 Estimated Story Points

Description

Rate limits for edits should be enforced

Acceptance criteria

  • A user without exemption from rate limits can not edit faster than the edit rate limit dictates.

Scenarios

Scenario: Too many edits

GIVEN I am on the Lexeme page
AND I have made the number of edits per time unit that equals the edit rate limit
AND I see edit buttons
WHEN I edit something
AND I submit changes
THEN Show the error message from the API (the general error handling in Wikibase) at the save button

Technical notes:

Example in PHP code of where checking rate limits happens in Wikibase : https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/repo/includes/EditEntity.php#L531

Event Timeline

WMDE-leszek set the point value for this task to 3.

All APIs and special pages edit using services / classes / code provided by WIkibase, all of which check the edit rate limits.
I'm not entirely sure how testable this is, but we could write an integration test for each API endpoint ensuring the rate limit is checked.

Change 423968 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/WikibaseLexeme@master] Test rate limit for all custom APIs and special pages

https://gerrit.wikimedia.org/r/423968

Moving to peer review.
Selenium / browser tests are not really possible here as we can't easily change the configuration for a single test.
All UI actions use the API anyway, so as long as the API returns the expected error in the default format the UI should handle that.

Change 423968 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Test rate limit for all custom APIs and special pages

https://gerrit.wikimedia.org/r/423968