Account Provisioner Testing

From MozillaWiki
Jump to: navigation, search

JSON formats

JSON comes into the account provisioner in two ways - via the first providerList lookup, and when getting search results via suggestFromName.


If the providerList is corrupt (invalid JSON), the AP goes into "offline mode", and tells the user that it's having difficulty connecting with the server. It will retry every 5 seconds.

If the providerList is received, and one of the providers has not included one of the required fields (id, label, paid, languages, api, tos_url, privacy_url), then the provider is not included in the list. The other two fields (icon, search_engine) are optional. If those fields are not included, then the icon is simply not displayed, and the option to set the search engine as default is not displayed to the user.


If the results returned from the server are corrupt (invalid JSON), then a "no results" message is displayed to the user, along with a link to some free email account providers.

Each individual result from suggestFromName is checked to ensure that "succeeded" is true, that the number of returned addresses is greater than 0, that the provider is included in our list of providers, and that the "product" field matches "personalized_email". Search results that do not conform to these requirements are not displayed.

Link handling

The only URLs displayed to the user as clickable links are the Terms of Service and Privacy links for each provider, and the link to the list of free email providers. These links all open in the default browser.

Error handling

When loading the providerList, connection problems or timeout results in a "connection problem" error message being displayed, and the search fields being disabled. The account provisioner retries connecting every 5 seconds, and will re-enable the search fields and hide the error message once a successful connection and download of providers has been made.

When loading search results, if there are connection problems or timeout, a "no results" message is displayed, along with a link to the list of free email providers.

When the provider returns the XML for creating a user account, we currently have no feedback to the user if the XML is corrupt or incomplete. We *do* log the problem in the error console, but the user does not see this. I've filed bug 704868 to track this problem.