Page MenuHomePhabricator

API should always return the filter id as a number
Open, LowPublic

Details

Reference
bz52201

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:59 AM
bzimport set Reference to bz52201.
bzimport added a subscriber: Unknown Object (MLST).
He7d3r set Security to None.
Tarrow subscribed.
Daimona subscribed.

While this could be fixed, it's good to explain why it's returned as a string: global filters. For instance, if you query AbuseLog, there may be a hit from global filters, for which the ID will be "global-xxx" with xxx being a number. The AbuseFilter/modify log could actually return it as an integer, since I think that will always be a local (numeric) ID. Abusefilters query instead returns it as int because it's a list of local filters, each one with a numeric ID.
Probably, the proper fix is to split it in filter_id and is_global, the first being a number and the second a boolean for AbuseLog. For AbuseFilter/modify, basically the same, but only if global filters are really included (otherwise, just use integers). Related to T42757.

@Daimona now that the global designation is separate from the filter ID, can this be actioned?

@Daimona now that the global designation is separate from the filter ID, can this be actioned?

It's not separate yet. Only the schemas have been merged. We still have to get the new schemas on WMF wikis (T234052), then add the code for it (https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/AbuseFilter/+/459818/), and then complete the migration (which will take some time). However, yes, after the migration is complete this should be trivial (chances are, it could even get fixed during the process without noticing).