Page MenuHomePhabricator

On MentorDashboard the mentorship-weight always displays Average, regardless of the option stored
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to Special:MentorDashboard
  • Change the "Number of mentees assigned to me" from Average to something else
  • See the confirmation toast
  • Reload Special:MentorDashboard

What happens?:
Special:MentorDashboard reports that the weight is "Average" even if it is not

What should have happened instead?:
Special:MentorDashboard should report the current value

Software version (skip for WMF-hosted wikis like Wikipedia):
MW Production

Other information (browser name/version, screenshots, etc.)
Via the API, we are able to validate that the uiprop option for this, "growthexperiments-mentorship-weight" is actually changing (1 - less, 2- Average, 4- More) - and that the stored value there continues to be stored on reload

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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

[mediawiki/extensions/GrowthExperiments@master] MentorTools: Ensure weight setter displays correct weight

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

Urbanecm_WMF triaged this task as High priority.

Bug in actively maintained feature => High.

Thank you @Xaosflux for filling this task! Fortunately, this is indeed only a display issue. Attached patch should fix it. Moving to code review!

The fix looks good for the unstructured version, but Special:MentorDashboard with structured mentorship enabled also always shows Average, because there is no structured version of the weight manager. Is that tracked somewhere?

Change 818624 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] MentorTools: Ensure weight setter displays correct weight

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

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

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.23] MentorTools: Ensure weight setter displays correct weight

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

Change 819085 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.23] MentorTools: Ensure weight setter displays correct weight

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

The fix looks good for the unstructured version, but Special:MentorDashboard with structured mentorship enabled also always shows Average, because there is no structured version of the weight manager. Is that tracked somewhere?

Good point! I don't think it is tracked, filled as T314362: Ensure MentorWeightManager is not used with structured mentor list.

@ValeJappo: FYI, this should be already fixed in production. Fortunately, it was only a display bug (what you selected got saved correctly, but the dashboard didn't read it properly when reloading).

@Urbanecm_WMF - can you confirm the fix in the production? testwiki wmf.23 has structured mentorship enabled as mentioned in https://phabricator.wikimedia.org/T314050#8122421 and the issue is still there (tracked in T314362: Ensure MentorWeightManager is not used with structured mentor list).

"None" option actually gets saved without any issues.

Testing in beta labs, I noticed couple of issues - I filed it as T314691: [betalabs] Mentorship pages issues

@Urbanecm_WMF - can you confirm the fix in the production? testwiki wmf.23 has structured mentorship enabled as mentioned in https://phabricator.wikimedia.org/T314050#8122421 and the issue is still there (tracked in T314362: Ensure MentorWeightManager is not used with structured mentor list).

Sorry, I should've made this more clear in the task. The fix is in production, but it only works with the wikitext mentor list (with structured mentor list, there is an additional issue [the dashboard writes to MediaWiki:GrowthMentors.json, but reads from preferences], which is tracked in T314362, as you mentioned). Fixes for both tasks are merged, but I only backported the patch for wikitext mentor list, as that's what we use on all our wikis as of now.

Since we don't have any train this week, I'll backport the rest as well, so this is fixed everywhere, and can be closed.

"None" option actually gets saved without any issues.

Testing in beta labs, I noticed couple of issues - I filed it as T314691: [betalabs] Mentorship pages issues

Thanks! I'll check those as well.

@Urbanecm_WMF - can you confirm the fix in the production? testwiki wmf.23 has structured mentorship enabled as mentioned in https://phabricator.wikimedia.org/T314050#8122421 and the issue is still there (tracked in T314362: Ensure MentorWeightManager is not used with structured mentor list).

Since we don't have any train this week, I'll backport the rest as well, so this is fixed everywhere, and can be closed.

Done. It should now work at test.wikipedia as well.

Re-checking in cswiki betalabs and testwiki wmf.23.

The original issue (see the steps below) - is still present, i.e. reloading Special:Mentor page after changing "Number of mentees assigned to me" (and after the confirmation message was displayed and gone) will always return to the initial value (not to Average (default), but to the value that was initially displayed).

Go to Special:MentorDashboard
Change the "Number of mentees assigned to me" from Average to something else
See the confirmation toast
Reload Special:MentorDashboard

However, a more realistic scenario shows correct behavior - the new values for the "Number of mentees assigned to me" are saved and displayed correctly.

Go to Special:MentorDashboard
Change the "Number of mentees assigned to me" from Average to something else
See the confirmation toast
Navigate to a different page and then return to Special:MentorDashboard will display the updated "Number of mentees assigned to me"  - CORRECT behavior.

Questions to @Urbanecm_WMF :
(1) The issue with reloading Special:MentorDashboard - that issue will be fixed when all fixes mentioned in T314362 get deployed?
(2) The reason I asked you to check in production was that I'm not a mentor anywhere except testwiki (which has enabled structured mentorship). I thought it'd be great to check the fix on wikis with un-structured mentorship.

Re-checking in cswiki betalabs and testwiki wmf.23.

The original issue (see the steps below) - is still present, i.e. reloading Special:Mentor page after changing "Number of mentees assigned to me" (and after the confirmation message was displayed and gone) will always return to the initial value (not to Average (default), but to the value that was initially displayed).

Go to Special:MentorDashboard
Change the "Number of mentees assigned to me" from Average to something else
See the confirmation toast
Reload Special:MentorDashboard

However, a more realistic scenario shows correct behavior - the new values for the "Number of mentees assigned to me" are saved and displayed correctly.

Go to Special:MentorDashboard
Change the "Number of mentees assigned to me" from Average to something else
See the confirmation toast
Navigate to a different page and then return to Special:MentorDashboard will display the updated "Number of mentees assigned to me"  - CORRECT behavior.

Thanks for the info. I played with the interface a bit more, and it looks like the key is to wait a while on the page. I'm only able to reproduce if I refresh quickly (waiting even for the message to go away results in correct behavior on my end). I don't think we necessarily need to figure the reason for that out (considering it works in the realistic scenario).

Questions to @Urbanecm_WMF :
(1) The issue with reloading Special:MentorDashboard - that issue will be fixed when all fixes mentioned in T314362 get deployed?

I don't think so. The remaining fix in that task is only to ensure we notice if the incorrect way to read mentor weight is used with the structured list (it will throw a fatal error rather than silently misbehaving, which should be noticeable during chores). All functional changes should be deployed to wmf.23 already.

(2) The reason I asked you to check in production was that I'm not a mentor anywhere except testwiki (which has enabled structured mentorship). I thought it'd be great to check the fix on wikis with un-structured mentorship

Aha, didn't know that. I think it'd be useful to have you as a mentor at other wiki than testwiki. We can either enable mentorship at test2.wikipedia (not active there ATM), or you can sign up as mentor at a non-test wiki (for example, Marshall and me are enrolled at en.wikipedia through the manual list for testing purposes; Czech Wikipedia has manual list as well, and you'd be welcomed in that one as well).

I tried testing at production cs.wikipedia, and I only see the issue there if I refresh quickly after selecting (first refresh displays old value, second refresh displays the correct one). As I mentioned above, I think it's acceptable if it works fine in realistic scenarios -- but I'm happy to dig further if you disagree :).