Page MenuHomePhabricator

Get rid of LinksUpdate::setTriggeringUser() hacks
Open, Needs TriagePublic

Description

The code restored in rMW829c4a8503ea: RefreshLinksJob: Restore LinksUpdate::setTriggeringUser() call isn't ideal, but Echo needs it for now.

Quick notes from IRC for now:

[10:54:20] <AaronSchulz> legoktm: that feature should be re-thought, since I'm not sure how to deal with those problems
[10:55:36] <legoktm> AaronSchulz: Do you have ideas on where else we can hook in to determine when new links get added and by whom?
[10:56:37] <AaronSchulz> using linksupdate hooks is fine for the first part (and does not need triggering user stuff in jobs). The second part is the hard one.
[10:57:28] <AaronSchulz> category membership RC stuff just handles it for direct edits to articles and for unconditional cat links for templates
[10:57:44] <AaronSchulz> for the later it just says "template X (and Y including pages) added to cat Z"
[10:58:12] <AaronSchulz> doesn't enumerate each transcluding page with the author

Event Timeline

Legoktm raised the priority of this task from to Needs Triage.
Legoktm updated the task description. (Show Details)
Legoktm added subscribers: Legoktm, aaron.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

[10:55:36] <legoktm> AaronSchulz: Do you have ideas on where else we can hook in to determine when new links get added and by whom?[10:55:36] <legoktm> AaronSchulz: Do you have ideas on where else we can hook in to determine when new links get added and by whom?

I don't understand the problem. The LinksUpdate hook gets a LinksUpdate object. It can call $this->getRevision()->getUser() to find out who changed the links, and $this->getAddLinkes() to list the new links.

Now, $this->getRevision()->getUser() is not necessarily the user who triggered the update (e.g. in case of a purge or null edit, it may well be a different user). But the triggering user is NOT the user who added the links! The links where added by the user returned by $this->getRevision()->getUser(), no?