Page MenuHomePhabricator

Structured mentor list should validate the maximum length of a mentor message
Closed, ResolvedPublic

Description

The Growth-Team is working on a structured mentor list as part of T264343. One of the goals for this project is to make it easy to validate the mentor list content when a mentor signs up or changes their details (such as, message). It turns out we don't validate the maximum message length in Special:EnrollAsMentor (at least, I didn't check the message change dialog yet).

https://en.wikipedia.beta.wmflabs.org/w/index.php?title=MediaWiki:GrowthMentors.json&diff=552390&oldid=552389 is an example of a change that should not be possible.

Ticket origin: @KStoller-WMF's comment at T312102#8058414.

Acceptance criteria
  • When structured mentor list is enabled, Special:EnrollAsMentor does not let soon-to-be mentors to enter an introduction message that's longer than the prescribed limit (as of today, 240 characters)
  • When structured mentor list is enabled, mentors are not able to set a longer introduction message than 240 characters via Special:MentorDashboard.

Event Timeline

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

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

[mediawiki/extensions/GrowthExperiments@master] Enforce maximum message length in StructuredMentorWriter

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

Change 814763 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Enforce maximum message length in StructuredMentorWriter

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

@Urbanecm_WMF - I checked on cswiki betalabs - there is no limit on accepted message's length for "Introduction message" on Special:EnrollAsMentor. Another issue with the entered message is on enwiki betalabs - filed as T314691: [betalabs] Mentorship pages issues.

@Urbanecm_WMF - I checked on cswiki betalabs - there is no limit on accepted message's length for "Introduction message" on Special:EnrollAsMentor.

Thanks for checking this. I double-checked the behavior, and I didn't manage to enter more than 240 characters (the input textbox for the message stops accepting new characters after reaching the limit). If I change limit in the maxlength="240" HTML attribute to a higher limit, and submit the dialog that way, the following error message appears:

image.png (424×1 px, 40 KB)

Granted, the fact I reached the limit is not super-clear (typing just stops writing), and a counter would be useful (covered by T312575). If that makes things more clear, we can remove the HTML maxlength attribute and rely on the server-side rejection.

Can you please have another look?

Another issue with the entered message is on enwiki betalabs - filed as T314691: [betalabs] Mentorship pages issues.

Thanks! I'll check that as well.

@Urbanecm_WMF - I checked on cswiki betalabs - there is no limit on accepted message's length for "Introduction message" on Special:EnrollAsMentor.

Thanks for checking this. I double-checked the behavior, and I didn't manage to enter more than 240 characters (the input textbox for the message stops accepting new characters after reaching the limit). If I change limit in the maxlength="240" HTML attribute to a higher limit, and submit the dialog that way, the following error message appears:

image.png (424×1 px, 40 KB)

Granted, the fact I reached the limit is not super-clear (typing just stops writing), and a counter would be useful (covered by T312575). If that makes things more clear, we can remove the HTML maxlength attribute and rely on the server-side rejection.

Can you please have another look?

I checked cswiki betalabs and testwiki wmf.25 - works as expected: on Special:EnrollAsMentor messages longer than 240 characters cannot be entered and the sufficient warning is presented to users.