Page MenuHomePhabricator

Types of throttles are hardcoded in SpecialOverrideThrottle::getFormFields
Closed, ResolvedPublic

Description

foreach( array( 'actcreate', 'edit', 'move', 'mailpassword', 'emailuser' ) as $type ) {

According to my quick check of User::pingLimiter, there are also:

linkpurge
rollback
renderfile

And in extensions:

moodbar-response
moodbar-feedback
pagetriage-mark-action
pagetriage-tagging-action
feedback (ReaderFeedback)
thanks-notification
create (used in Wikibase)

I don't think it makes sense to expose some of these in the UI, but I'm not sure if we should totally ignore them either.


Version: unspecified
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:01 AM
bzimport set Reference to bz60419.
bzimport added a subscriber: Unknown Object (MLST).

I thought about this a bit more, and realized that the rationale in bug 25000 is only about account creation.
What if we had a config variable like $wgThrottlesToOverride = array( 'actcreate' ) so they wouldn't need to be hardcoded, and the UI would become less cluttered (IMO).
It would also solve the issue of not being able to override extensions' throttles.

I note that the ThrottleOverride schema currently has

+-----------------+-----------------------------------------------------------+------+-----+---------+----------------+
| Field           | Type                                                      | Null | Key | Default | Extra          |
+-----------------+-----------------------------------------------------------+------+-----+---------+----------------+
| thr_id          | int(10) unsigned                                          | NO   | PRI | NULL    | auto_increment |
| thr_type        | set('actcreate','edit','move','mailpassword','emailuser') | NO   |     | NULL    |                |
...

which means we'll need to change the type of the thr_type field in order to be able to allow other throttle types. As this field contains a string with a comma-seperated list of throttle types, could we just change this to varchar (I'm not very familar with mysql data types and which would be appropriate)?

Change 380061 had a related patch set uploaded (by EddieGP; owner: EddieGP):
[mediawiki/extensions/ThrottleOverride@master] Introduce config variable for throttle types

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

EddieGP raised the priority of this task from Low to Medium.Sep 24 2017, 12:32 AM

Change 380061 merged by jenkins-bot:
[mediawiki/extensions/ThrottleOverride@master] Introduce config variable for throttle types

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