Page MenuHomePhabricator

"createaccount" action failure should return the name of the extension that caused it to fail.
Closed, ResolvedPublic

Description

In our Android app, we allow the user to create an account, and if the API rejects the account creation request, we would like to tell the user exactly why it was rejected.

When the createaccount action fails because of an extension, we get back a "code" of "createaccount-hook-aborted", which is not specific enough for us to understand what the exact error is.

We do see the "info" text, which is HTML, but we don't want to display it as-is inside the app, for various reasons (e.g. localization).

Ideally the API should tell us which extension was responsible for rejecting the request, so that we may decide how to present the corresponding error to the user.


Version: unspecified
Severity: normal

Details

Reference
bz72387

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:58 AM
bzimport set Reference to bz72387.
bzimport added a subscriber: Unknown Object (MLST).

I think AntiSpoof just needs to use the API specific hooks (like was done to ConfirmEdit in Id628defaeab2bf5979ca8f4284d14fc42d9c3e46).

The API-specific hooks aren't actually necessary for this. AddNewAccountApiForm is really intended for mapping from parameters named in API style (such as "captchaid" and "captchaword") to form style (such as "wpCaptchaId" and "wpCaptchaWord"), while AddNewAccountApiResult is for adjusting a non-fatal outcome.

AntiSpoof needs to update its AbortNewAccount hook function to use the $abortStatus parameter added to that hook in 1.23, if it wants to avoid a generic 'createaccount-hook-aborted' message.

Is this really good first task ? AntiSpoof uses a few different messages (antispoof-conflict-top, antispoof-conflict-item, antispoof-conflict-bottom) to generate some HTML so it can show multiple conflicts, but the Status class wants to be given a Message.

Is this really good first task ? AntiSpoof uses a few different messages (antispoof-conflict-top, antispoof-conflict-item, antispoof-conflict-bottom) to generate some HTML so it can show multiple conflicts, but the Status class wants to be given a Message.

I threw on that tag based on:

AntiSpoof needs to update its AbortNewAccount hook function to use the $abortStatus parameter added to that hook in 1.23, if it wants to avoid a generic 'createaccount-hook-aborted' message.

Which sounded good first task to me but may really not be.

I think this is probably resolved. The generic "createaccount-hook-aborted" message mentioned in the task description is not used since 2018 (see https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1049937), so any extension has to provide a custom error message. And speaking of AntiSpoof specifically, it tried really hard to provide a useless error message despite the requirement, until I fixed T167163 last year.