Mark up http errors + missing image errors with generic error attributes + error info in data-mw
Closed, ResolvedPublic

Description

Image patch (https://gerrit.wikimedia.org/r/#/c/57817/) is missing error handling when the mw API is queried to get information about an image.

Two kind of errors that handleResponse in LinkHandler.js has to deal with:

(1) API error: Given that ApiRequest retries, an api error is an indication that the api may be temporarily down or that something else is wrong. So, rather than continue, it is better to abort processing and return an error code to the clients so they can handle it however they want (ex: ve might tell the user that the page cannot be edited right now because of api/server issues). This will require calling the error callback found in env.

(2) Image missing: If the api comes back and tells us that the image is missing, we should handle this similar to how the PHP parser does it for missing images.

  • Maybe link to a special page/url that will let VE present an upload handler (check with VE folks as to what this url could be. PHP parser behavior can be found by editing a page on wikipedia sandbox with a non-existent image)
  • Dont add a thumb.
  • Add a special rdf type on the image/wrapper tag: mw:Image/Missing maybe?

Version: unspecified
Severity: normal

bzimport added a project: Parsoid.Via ConduitNov 22 2014, 1:37 AM
bzimport set Reference to bz48900.
ssastry created this task.Via LegacyMay 28 2013, 5:00 PM
GWicke added a comment.Via ConduitJun 21 2013, 2:37 AM

Before merging Mark's image patch I added very basic error handling that at least round-trips the image in case something goes wrong. This uses a simple mw:Placeholder for now, but we should probably create a generic error RDFa type that lets us report localizable errors while still ensuring round-tripping.

To let editors fix such an issue it might be useful to attach the regular DOM structure to the error wrapper. We'd also need to point out which property needs to be fixed, so that a client like the VisualEditor can provide a useful dialog.

GWicke added a comment.Via ConduitJun 24 2013, 8:03 PM
  • Bug 50035 has been marked as a duplicate of this bug. ***
Aklapper added a comment.Via ConduitJul 4 2013, 10:35 AM

[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

GWicke added a comment.Via ConduitJul 12 2013, 1:02 AM
  • Bug 51039 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitJul 12 2013, 4:22 PM
  • Bug 51244 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitJul 15 2013, 1:43 AM
  • Bug 50290 has been marked as a duplicate of this bug. ***
GWicke added a comment.Via ConduitJul 17 2013, 3:28 PM
  • Bug 51535 has been marked as a duplicate of this bug. ***
GWicke added a comment.Via ConduitJul 17 2013, 3:39 PM

We recently discussed this again. A possible solution might be to mark arbitrary elements as error-affected using an additional mw:Error typeof (or CSS class), plus error information in data-mw.error. This error information can be an object like this:

{

key: "missing-image",
msg: "This image did not exist"

}

The key can be used to retrieve localized messages. The msg just provides a non-localized fall-back. We could leave that out too if we are concerned about space.

For images, we'd use the standard DOM structure as if the image existed, but point out the error with the typeof and data-mw so that the VE can help the user to fix the issue. Similarly, bots can look for errors and potentially fix them automatically.

Jdforrester-WMF added a comment.Via ConduitJul 18 2013, 3:35 PM
  • Bug 51615 has been marked as a duplicate of this bug. ***
ssastry added a comment.Via ConduitSep 25 2014, 2:18 PM

We should tackle this one soon since this blocks Flow from removing data-parsoid from their code. They use data-parsoid for missing images to render links. We currently emit a mw:Placeholder meta for it.

gerritbot added a comment.Via ConduitOct 31 2014, 10:48 PM

Change 170455 had a related patch set uploaded by Subramanya Sastry:
WIP: (Bug 48900) Add mw:Error + error info to data-mw for missing imgs

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

Jdforrester-WMF moved this task to Requests from VE/Flow/others on the Parsoid workboard.Via WebNov 26 2014, 5:35 PM
ssastry lowered the priority of this task from "Unbreak Now!" to "High".Via WebDec 2 2014, 9:48 AM
ssastry set Security to None.
ssastry moved this task to In Progress on the Parsoid workboard.Via WebDec 4 2014, 8:26 AM
gerritbot added a comment.Via ConduitDec 4 2014, 6:10 PM

Change 170455 had a related patch set uploaded (by Subramanya Sastry):
T50900: Add mw:Error error info to data-mw for missing imgs

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

Patch-For-Review

Ironholds removed a subscriber: Ironholds.Via WebDec 5 2014, 7:44 PM
gerritbot added a comment.Via ConduitDec 9 2014, 6:24 PM

Change 170455 merged by jenkins-bot:
T50900: Add mw:Error error info to data-mw for missing imgs

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

ssastry closed this task as "Resolved".Via WebDec 17 2014, 10:36 PM

This has been deployed.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.