Page MenuHomePhabricator

Display a proper message when it's raised by EditFilterMergedContent messages
Open, Needs TriagePublic

Description

I think we should display a proper error message when the EditFilterMergedContent hook complains. This hook is run manually via https://gerrit.wikimedia.org/g/mediawiki/extensions/GrowthExperiments/+/c152954b01e06152b5bbc19bb40b5c2263facb70/includes/HelpPanel/QuestionPoster/QuestionPoster.php#499, and apparently, even when AbuseFilter sets a valid error message, it's not displayed.

Doing something more "alike" the EditPage logic could help, as well as completing T266464 first.

However, it also seems that our current JavaScript client for the questionposter API doesn't really respect any error message raised, and always throws growthexperiments-help-panel-question-post-error. Let's replace it with the passed error message, if it's not hookaborted (which is even more generic).

As an example, see https://people.wikimedia.org/~urbanecm/screencasts/T266465.webm.

Event Timeline

Change 636414 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/extensions/GrowthExperiments@master] Do not fail with a generic erorr message "Something went wrong" when aborted with a non-good status

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

Change 636414 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Do not fail with a generic error message "Something went wrong" when aborted with a non-good status

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

This is related to T222204: Homepage: improve error handling for questions that trigger abuse-filter which has a bunch of discussion on how it should be handled, and also a patch which does similar things than the patch here, but also tries to handle the (rather unreasonable) error output from the hook better. Maybe worth reviving?

Also, I'm a bit skeptical about these messages being usable - on many wikis they just tend to be really verbose and not written with custom dialogs in mind. (E.g. here's enwiki's version of the email warning mentioned in T266384: Users sharing emails addresses when asking questions using the Newcomers homepage.) That's not something that's easy (or even moderately hard) to fix, I filed T266907: AbuseFilter should provide error/warning messages in an API-friendly plaintext format so there's a task about the issue at least.

I think they're more usable than our current error message, so a definite
improvement. In each case, this should be an edge case.