Page MenuHomePhabricator

Update user edit count before invoking event listeners in hooks.
Open, MediumPublic

Description

Currently, after an edit, listeners registered by extensions get invoked before the user edit count is updated. This is the case even though UserEditTracker::incrementUserEditCount() is called from ChangeTrackingEventIngress before extension listeners get invoked. The reason is that incrementUserEditCount() doesn't update the database immediately, it schedules an UserEditCountUpdate which will be executed in a later round of deferred updates, after event listeners.

This was probably caused by moving the invocation of incrementUserEditCount() into an ingress object when introducing domain event handling into MediaWiki core.

NOTE: Change this behavior might impact extensions that are making assumptions about the order of execution, and try to work around this issue by predicting the edit count. It may also affect extensions that use the UserEditCountUpdate hook.

Event Timeline

(I'm putting it on our board in the Tracking column so that we keep an eye on it because it is important 1) to the notifications related to reaching community-thresholds for limiting Add a Link (T393771), and 2) because the Echo notifications for celebrating the editors on their 1st, 10th, 100th, 1000th, ... edit is coupling to that logic.)

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly point to the codebase URL and provide clear steps to help a contributor get set up for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3

I'm not sure if this is currently a good first task - e.g., looking at the current task description, I'm not sure what codebase(s) need to be changed, and/or where they'd need to be changed. I also wouldn't expect newcomers to necessarily be familiar with the class/function names within the task description (ie., in the same way that an experienced developer might be); and TBH the note that this change might have side-effects on multiple extensions causes me to think that - even with a more explanatory task description - this might not be the sort of task best suited for a newcomer to Wikimedia/MediaWiki development. [xref the automatic comment above.]