Dummy edits not tagged by OAuth
OpenPublic

Assigned To
None
Priority
Low
Author
Bawolff
Subscribers
bd808, Ricordisamoa, Anomie and 5 others
Projects
Reference
bz62908
Security
None
Description
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz62908.
Bawolff created this task.Via LegacyMar 21 2014, 1:58 AM
Anomie added a comment.Via ConduitMar 21 2014, 2:16 PM

(In reply to Bawolff (Brian Wolff) from comment #0)

Perhaps something to do with the dummy edit being hidden from RC (?)

That is very likely the case: OAuth uses the RecentChange_save hook to tag things (see MWOAuthAPISetup::onRecentChange_save), so if that hook doesn't get called for the dummy edit then OAuth won't tag it.

The next step here would be to identify (or add) a hook that is called when these dummy edits are created but not saved as recent changes, so we can hook that too. I'm not terribly familiar with the uploading code path, so if you are and can point to where the dummy edit gets created that would be helpful. Otherwise I'll try to remember to track it down later.[1]

[1]: (although what'll probably happen then is that I'll forget until Andre pings us in a few months asking if there's any progress)

Bawolff added a comment.Via ConduitMar 22 2014, 12:06 AM

It's created with a line like:

$status = $wikiPage->doEditContent(
        $content,
        $comment,
        EDIT_NEW | EDIT_SUPPRESS_RC,
        false,
        $user
);

in LocalFile::recordUpload2. (A slightly different but similar code path is used for re-uploads)

Could perhaps add $flags to NewRevisionFromEditComplete hook.

Anomie added a comment.Via ConduitMar 24 2014, 3:27 PM

Thanks for that, now I see where to look in the code.

NewRevisionFromEditComplete looks like it'd probably be a good hook to use since it seems to be called from a few other relevant code paths too that directly insert the revision. Unfortunately, it also looks like you're right that we'd need to add some sort of flagging to the hook (although that seems a bit "ugh" to me considering every other caller would probably have to fake it), or else fix ChangeTags::addTags so that calling ChangeTags::addTags( $tags, null, $rev_id, null ) then ChangeTags::addTags( $tags, $rc_id, $rev_id, $log_id ) will update the change_tag table with the $rc_id and $log_id instead of just completely ignoring the second call.

Ricordisamoa added a subscriber: Ricordisamoa.Via WebFeb 12 2015, 9:59 AM
Ricordisamoa changed the title from "Dummy edits not tagged by oAuth" to "Dummy edits not tagged by OAuth".Via WebMar 1 2015, 6:48 AM
Ricordisamoa edited the task description. (Show Details)
Ricordisamoa set Security to None.
bd808 triaged this task as "Low" priority.Via WebFri, Mar 6, 1:39 AM
bd808 added a subscriber: bd808.
Deskana moved this task to Tool User wants on the MediaWiki-extensions-OAuth workboard.Via WebFri, Mar 6, 10:56 PM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.