Page MenuHomePhabricator

Enforce edit rate limits when editing lexeme
Closed, ResolvedPublic3 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

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseLexeme : masterTest rate limit for all custom APIs and special pages

Event Timeline

WMDE-leszek triaged this task as Medium priority.Mar 12 2018, 1:26 PM
WMDE-leszek created this task.
WMDE-leszek updated the task description. (Show Details)Mar 12 2018, 4:33 PM
Addshore updated the task description. (Show Details)Mar 13 2018, 10:23 AM
WMDE-leszek updated the task description. (Show Details)Mar 13 2018, 11:32 AM
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.

Addshore claimed this task.Apr 4 2018, 4:29 PM
Restricted Application added a project: User-Addshore. · View Herald TranscriptApr 4 2018, 4:29 PM
Addshore moved this task from To Do to Doing on the Wikidata-Turtles-18.03.28 board.

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

Lydia_Pintscher closed this task as Resolved.Apr 6 2018, 4:55 PM