Page MenuHomePhabricator

IPInfo: Returned translated error message not used in popup, instead always using the default error message
Closed, ResolvedPublic2 Estimated Story Points

Description

Summary

The IP Info extension provides a popup which can be used to get IPInfo data about a target. When this request fails, the translated error message is defined to be preferred. However, this is not displayed due to a bug.

Background

  • The IP Info popup widget is present on pages like the history page
  • This popup displays IPInfo data for users with access
    • However the icon to open the popup still shows for users who are site-wide blocked but still have the needed right
  • When a user is site-wide blocked, the popup when opened should display some kind of error indicating the failure
    • However, it instead just displays the generic details

User story

As a user using the IP Info tools I want to know why my request to get IPInfo data using the popup failed, and not just see a generic error message

Technical notes

  • It appears that the handler for a failed request does not take the second errorObject argument and assumes the first argument contains this data
    • Furthermore, the structure of error parameter (even if it was the second errorObject argument) seems to be incorrectly defined

Acceptance criteria

  • When there is a specific translated error message returned by the IP Info API, the popup should display this error over the default generic message

Event Timeline

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

Change #1119221 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/IPInfo@master] Display translated error message when returned by REST API

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

Change #1119221 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Display translated error message when returned by REST API

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

Change #1122981 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/IPInfo@master] Add tests for ext.ipInfo/infobox/widget.js and ext.ipInfo/rest.js

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

Change #1122994 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GrowthExperiments@master] Fix FiltersStore.test.js to stub mw.Api instead of spying it

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

Change #1122994 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Fix FiltersStore.test.js to stub mw.Api instead of spying it

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

Change #1122981 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Add tests for ext.ipInfo/infobox/widget.js and ext.ipInfo/rest.js

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

Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected ( When a user is site-wide blocked, and selects the IP Info popup icon, it will display a translated error message indicating the type of failure that has occurred).

image.png (161×1 px, 45 KB)