Last modified: 2014-10-14 12:07:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53421, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51421 - VisualEditor: Allow AbuseFilter rules to identify VE edits
VisualEditor: Allow AbuseFilter rules to identify VE edits
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-16 03:25 UTC by Robert Rohde
Modified: 2014-10-14 12:07 UTC (History)
14 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Robert Rohde 2013-07-16 03:25:06 UTC
I would like to request that some flag or other indicator be added such that abuse filter rules can tell whether the edit is coming from VE or from the source editor.

Because the abuse filter tends to encourage different sorts of editor errors, it would be useful to know which interface is being used when editing.  For example, a nowiki tag added by the source editor is almost certainly intentional, while a nowiki added by VE is probably an accident and should be tagged for inspection.
Comment 1 Matthew Flaschen 2013-07-16 03:49:37 UTC
Both AbuseFilter and VisualEditor use change tags.  It might be possible for AbuseFilter to use VisualEditor's tag if AbuseFilter runs after, though I don't see tags mentioned at https://www.mediawiki.org/wiki/Extension:AbuseFilter/Rules_format
Comment 2 James Forrester 2013-07-17 15:36:47 UTC
This would need AbuseFilter to be extended to understand tags (or, to understand VisualEditor, which seems a less satisfying and extensible way of achieving this).
Comment 3 Richard Morris 2013-07-30 16:30:47 UTC
Can the abusefilter detect veaction=edit. Using that and we could block edits which insert nowikis from the VE when they are almost always in error and allow them from wikitext editor, when they are normally ment.
Comment 4 Kevin Norris 2013-07-30 16:55:47 UTC
Wait, if the AbuseFilter is going to understand tags, and already applies tags, what order will filters run in?  What if a later filter applies a tag that would have triggered an earlier filter?  Should MW just keep re-running the filters until everything's been triggered?
Comment 5 Bartosz Dziewoński 2013-07-30 16:57:03 UTC
I'm pretty sure it's impossible to do this since any kind of tags can be only added after an edit is saved (ChangeTags::addTags() function requires the edit to have a know rev_id which implies that it already exists in the database).
Comment 6 James Forrester 2013-07-30 17:02:02 UTC
(In reply to comment #5)
> I'm pretty sure it's impossible to do this since any kind of tags can be only
> added after an edit is saved (ChangeTags::addTags() function requires the
> edit to have a know rev_id which implies that it already exists in the
> database).

Does AF's hook happen after VE's save (which applies tags), at least?
Comment 7 Bartosz Dziewoński 2013-07-30 17:41:42 UTC
AF's hook attempts *during* save, in EditPage#runPostMergeFilters and ApiEditPage#execute (the second one is only used to present nicer information about saving failure in the API and is what VE is actually hitting, but that doesn't matter here).

VisualEditor's ApiVisualEditorEdit calls the edit API first (#saveWikitext) and only after it has succeeded calls ChangeTags::addTags to add the tags to the edit.

So to make this work, we'd have to adjust code in core, in AbuseFilter and in VE to allow passing change tags with the edit API call or in some magical way before it. It'd make the logic really awkward (since tags could now be added before/during and after making the edit, and the second kind would be invisible to VE) and likely introduce back-compat issues (for the same reason).

There are also requests to make the tags editable by users (bug 18670), which generally seems like a pretty good idea, but complicates the issue here even further.

So to summarize, I don't see this happening, but feel free to prove me wrong if you think you can tackle this :)
Comment 8 Bartosz Dziewoński 2013-07-30 17:42:55 UTC
s/attempts/happens/, of course.
Comment 9 Bartosz Dziewoński 2013-07-30 17:47:21 UTC
s/invisible to VE/invisible to AF/. I swear, I did proofread that. :)
Comment 10 Robert Rohde 2013-07-30 17:52:17 UTC
The original request was merely for the AbuseFilter to somehow be made aware whether or not an edit had come from VE as opposed to source editing.  

For example, the Abuse Filter is aware of "action=" but not "veaction=".  At present "action=edit" and "veaction=edit" look identical to the AbuseFilter.

I think the suggestion that AbuseFilter should somehow be allowed process tags generated by other entities is actually an unnecessary (and more complicated) diversion.
Comment 11 James Forrester 2013-07-30 20:09:05 UTC
(In reply to comment #10)
> The original request was merely for the AbuseFilter to somehow be made aware
> whether or not an edit had come from VE as opposed to source editing.  
> 
> For example, the Abuse Filter is aware of "action=" but not "veaction=".  At
> present "action=edit" and "veaction=edit" look identical to the AbuseFilter.

Adjusting comment accordingly.

> I think the suggestion that AbuseFilter should somehow be allowed process
> tags generated by other entities is actually an unnecessary (and more
> complicated) diversion.

Sure.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links