Page MenuHomePhabricator

Create a generic feedback interface that extensions/gadgets can use.
Open, LowPublic

Description

After talking with Rillke, we ended up discussing the idea of integrating problem reporting bugs like has been done with
[[commons:MediaWiki:Gadget-AjaxQuickDelete.js]]:

if (!this.disableReport) {
   dlgButtons[this.i18n.reportButtonLabel] = function() {
      $('#feedbackContainer').contents().remove();
      $('#feedbackContainer').append($('<img>', {
         src: '.../images/ajax-loader.gif'
      })).css('text-align', 'center');
      var randomId = Math.round(Math.random()*1099511627776);
      var toSend = '\n== Autoreport by AjaxQuickDelete ' + randomId + 
        ' ==\n' + err + '\n++++\n:Task: ' + o.currentTask +
        '\n:NextTask: ' + o.tasks[0] + '\n:LastTask: ' +
        o.tasks[o.tasks.length - 1] + '\n:Page: ' +
        (o.pageName || pageName) + '\n:Skin: ' +
        mw.user.options.get('skin') +
        '\n:[{{fullurl:Special:Contributions|target={{subst:urlencode:' +
        '{{subst:REVISIONUSER}}}}&offset={{subst:REVISIONTIMESTAMP}}}}' +
        ' Contribs before error]';
      $.post(o.apiURL, {
         'action': 'edit',
         'format': 'json',
         'title': 'MediaWiki talk:AjaxQuickDelete.js/auto-errors',
         'summary': '[[#Autoreport by AjaxQuickDelete ' + randomId +
                    '|Reporting an AjaxQuickDelete error.]] Random ID=' +
                    randomId,
         'appendtext': toSend,
         'token': (o.edittoken || mw.user.tokens.get('editToken'))
      }, function() {
         o.reloadPage();
      });
   };
}

Version: unspecified
Severity: normal

Details

Reference
bz35333

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:16 AM
bzimport set Reference to bz35333.
bzimport added a subscriber: Unknown Object (MLST).

Can you elaborate further what you're wanting to do?

See also:

  • [[pl:Special:PrefixIndex/MediaWiki:Gadget-wikidebug]]

His gadget has a try/catch system that calls a method that makes an AJAX request to a certain wiki page on behalf of the user. The edit adds a line with the caught error message etc.

Since this case is very specific to gadgets and related script I think this is not a use case for the core software.

It would be a perfect example of a utility gadget that other gadgets can use. Which would be centrally maintained in the gadget repository that is available on all wikis.

(In reply to comment #4)

Since this case is very specific to gadgets and related script I think this is
not a use case for the core software.

It makes sense for the gadget extension, though, right? Maybe switch component for this bug?

"Your" UploadWizard would be also benefit from automated error reporting. At least you could try to catch all the ridicules server errors that currently occur and report them to yourself without the need for a user collecting all of them and describing the bug in a way you aren't able to understand ;-).

Automatic problem reporting software is a common feature of most desktop-apps now, why not doing this with JavaScript? You would be aware of errors as soon as they occur, would be able to fix them fast because you know what you have to know and in the end, happy users. "I contributed resolving a problem - I made the software better!" by simply clicking a button (or not even that).

Just let me underline this using a simple example:
Currently, if you are using UpWiz and enter a name containing a "/", it tries to "publish" the file using this name, which of course fails
«There was a file by this name, "File:Defekter_Bahnautomat_(2)22/testtest.jpg", but it was deleted and you can not reupload the file. If your file is different, try renaming it.»
You would be aware of this problem (yes, it should show a descriptive error message or simply remove the "/"), if you would catch errors sent back from the servers.

Concerning the example, I just retried with another file and got

«Defekter_Bahnautomat_36/test_Defekter_Bahnautomat.jpg
Unknown warning: "badfilename".»

The file was fresh generated from an own photograph and has hit a hash of a deleted file. That's really interesting.

(In reply to comment #5)

(In reply to comment #4)

Since this case is very specific to gadgets and related script I think this is
not a use case for the core software.

It makes sense for the gadget extension, though, right? Maybe switch component
for this bug?

I disagree. I think the gadgets extension should never ship with pre-installed gadgets. This to avoid mass decentralization of gadgets (which are very hard, if not impossible, to reliably update, so we'd be left with a lot of gadgets installed on third party wikis, likely unused on most of them and not update-able).

Instead this is where sharing and community comes in. Anyone can create such a gadget if he sees a need for it, and (once Gadgets 2.0 is finished) it can be natively shared with other wikis that also need it.

Much like Chrome extensions or Firefox add-ons, except with multiple market places (repositories) and the wiki-admin 'decides' which repositories are trusted and are aggregated in the search and allowed for loading.

But I don't see a feature request nor a bug here. As far as I can see MediaWiki's ResourceLoader framework, the API and the mediawiki-JS library all allow doing something like this. And from what I read here, it has already been done on Commons to some degree.

(In reply to comment #9)

But I don't see a feature request nor a bug here.

The feature request was to provide a standard way for end users to report errors to the gadget developer.

In comment #8, you say it shouldn't be done.

(In reply to comment #9)

But I don't see a feature request nor a bug here.

So you are able letting users of upload wizard reporting their error somewhere?

  • Moving from ResourceLoader to extension requests. This is not a bug or feature request in the ResourceLoader. ResourceLoader is the framework for managing an delivering javascript, stylesheets and other module resources. This bug is about a user interface feature.
  • Renaming bug from an implementation example to a use case. We don't want to log to a wiki page per se, lets keep the possibilities open.

Note, that this could be a use case for the (existing) Feedback Dashboard, so maybe we don't have to create something new?

Some of the things it would have to support:

  • Feedback from readers about something they see in the article
  • Allowing a user to report an error as it happens in a gadget or extension. It should be able to not require/show the "mood" input, and it needs a way to specify a "channel" (a hidden parameter passed from the interface to the API -e.g. channel=gadget-foo or channel=ext-UploadWizard).
He7d3r added a project: JavaScript.
He7d3r set Security to None.