Hi, I propose have a question about the ability to create a new built-in variable for AbuseFilter used to retrieve page_last_edit_time (may be in seconds) similar to page_age variable, it's may be used to block bots from editing pages that have been recently edited (to minimize users-bots conflict), is that possible?
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add new variable for last edit time | mediawiki/extensions/AbuseFilter | master | +121 -5 |
Event Timeline
Hi @Mohnd_Kh, please ask questions how to do something or if something is possible in support channels instead.
Phabricator is for software bug reports and for feature requests. Thanks a lot! :)
Hi @Aklapper it's a proposal actually (request), but i didn't know if it's possible or not, so I was unsure about it, thank u
I forgot to answer -- yes, it would be possible. However, I would also expect such a variable to be slow.
@Mohnd_Kh: I see, thanks. In the future, please follow https://www.mediawiki.org/wiki/How_to_report_a_bug in such cases, to avoid misunderstandings. Thanks :)
This is very much needed; there have been several times where it would have been very helpful, in particular against harassment/houding by LTA.
If it's very much needed, I guess we should make it possible.
page_last_edit_time (may be in seconds) similar to page_age variable
AbuseFilter is somewhat messy in terms of working with timevalues. We have:
- user_age - seconds since account was created
- page_age - seconds since page was created
- user_emailconfirm - timestamp of email confirmation (as a 14-byte string)
- timestamp - current unix time, i.e., seconds since 1970-01-01 (casted to a string)
Except for type casts and traditional arithmetic operations, there is no native way to go, e.g., from timestamp to age (seconds since).
Does page_last_edit_age sound good?
Another thing to consider is the value when the page does not exist and is being created. If we set it to 0, it would be ambiguous because it is technically possible to edit a page twice within a second (mostly by bots on Wikidata). I think setting it to null is correct here, because there simply was "no last edit". In this case, filter maintainers must check for null before doing page_last_edit_age < ####.
Thanks. Imho, page_last_edit_age , aka seconds since last edit on page, would be fine. Ok for your second point, it seems logic to me; so we will always have to use page_last_edit_age != "null" (or page_age > 0? that should work too if I'm correct, but it is less explict).
Change 860964 had a related patch set uploaded (by Matěj Suchánek; author: Matěj Suchánek):
[mediawiki/extensions/AbuseFilter@master] Add new variable for last edit time
If it's very much needed, I guess we should make it possible.
Thx @matej_suchanek, I appreciate that.
Currently, the plan is to have https://gerrit.wikimedia.org/r/c/mediawiki/extensions/AbuseFilter/+/813686 merged first.
Then, this could be ready. But unfortunately, there are some troubles with the patch because ProofreadPage browser tests are failing for the patch (but not the other one).
Change #860964 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Add new variable for last edit time