Page MenuHomePhabricator

Users who opted-out mentorship get a mentor assigned to them
Closed, ResolvedPublicBUG REPORT

Description

Reported at de.wp:

A user who opted-out mentorship a while ago has no mentor name is visible on Special:Homepage, but the users get a name when using {{#mentor:}}.

Opted-out users are not supposed to have a mentor, nor be present in the mentor/mentee database.

Event Timeline

Thanks for Reporting. I can provide additional Information if necessary.

It seems that @Johannnes89 also has this issue: Johannes89
and some other users:

Urbanecm_WMF changed the subtype of this task from "Task" to "Bug Report".Nov 16 2023, 3:22 PM

Thanks @Trizek-WMF and @Janui, thanks for the report. I investigated this bug, and I can see that @Janui is opted out of mentorship, but they have a mentor assigned regardless. This is definitely a bug somewhere, but I'm not yet sure where exactly.

So, upon an initial investigation, I have some thoughts about how this bug can be fixed. I'll need more time to be able to prepare a correct fix for the problem. Thank you for your patience!

Just in case this causes any confusion: I didn't have the same issue (I have enabled both the homepage as well as the mentorship option for testing purposes). I just mentioned to other users that you @Janui noticed the bug.

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

[mediawiki/extensions/GrowthExperiments@master] MentorManager: Do not assign a mentor to opted-out users

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

I figured the root cause here. Even before the fix above, GrowthExperiments did drop the mentor/mentee relationship from the database and features like the Homepage or Help panel checked the mentorship state (enabled/opt-out) before directing the user to a mentor. However, in the case of the Help panel, the check only happened in the user interface. Backend still attempted to assign the mentor and pass that information to the Help panel UI. This is now fixed by checking for opt-out within MentorManager itself, so that any other part of GrowthExperiments receives correct data about mentorship from now on.

Moving this to Code Review now.

Change 975290 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] MentorManager: Do not assign a mentor to opted-out users

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