Page MenuHomePhabricator

When a mentor gets locked, mark them as away
Closed, ResolvedPublic

Description

In T318819: When a mentor gets blocked, mark them as away, we ensured that blocked mentors are marked as away for the duration of the block. However, at Wikimedia wikis, users can also be globally locked. A global lock has similar impact to a block (locked users are effectively unable to participate in mentorship), but it impacts all Wikimedia wikis at once.

We decided to treat locked mentors in the same way as we already treat blocked mentors (see T318819).

Acceptance criteria

Given a Mentor receives a global lock,
Then their Mentor status is automatically set to "Away". The mentor cannot mark as active via Special:MentorDashboard.

Given a Mentor receives a global llock and their Mentor status is set to "Away",
Then if/when the lock is over, they have the option to set their Mentor status as "Active" (and they will have the same mentees as before the block).

Event Timeline

Change 867687 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] MentorStatusManager: Treat locked mentors as away

https://gerrit.wikimedia.org/r/867687

Urbanecm_WMF changed the task status from Open to In Progress.Dec 13 2022, 6:47 PM

This will display as "Your primary mentor, FooBar, is currently away until <right now>." which seems confusing. The same is true for blocks as well.

Not related to the task but getEffectiveMentorForUser() is called something like 10 times to display the homepage (mostly because it is invoked by canRender() which is used quite a bit). It should really have an in-process cache.

Change 867687 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] MentorStatusManager: Treat locked mentors as away

https://gerrit.wikimedia.org/r/867687

Urbanecm_WMF added a subscriber: Etonkovidova.

@Etonkovidova Not sure how easy it is for you to test behavior wrt locked users. Feel free to ping me if you need one of your testing accounts locked.

This will display as "Your primary mentor, FooBar, is currently away until <right now>." which seems confusing. The same is true for blocks as well.

Not related to the task but getEffectiveMentorForUser() is called something like 10 times to display the homepage (mostly because it is invoked by canRender() which is used quite a bit). It should really have an in-process cache.

Good points. Filled as T325135: Add caching to MentorStatusManager and T325134: MentorStatusManager: Automatically away users are marked as away until TODAY respectively.

Urbanecm_WMF changed the task status from In Progress to Open.Dec 14 2022, 9:14 AM