Last modified: 2014-11-19 02:04:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50900, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48900 - Mark up http errors + missing image errors with generic error attributes + error info in data-mw
Mark up http errors + missing image errors with generic error attributes + er...
Status: PATCH_TO_REVIEW
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Highest normal
: ---
Assigned To: ssastry
:
: 50035 50290 51039 51244 51535 51615 (view as bug list)
Depends on:
Blocks: 50788 51544 52186
  Show dependency treegraph
 
Reported: 2013-05-28 17:00 UTC by ssastry
Modified: 2014-11-19 02:04 UTC (History)
13 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description ssastry 2013-05-28 17:00:53 UTC
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?
Comment 1 Gabriel Wicke 2013-06-21 02:37:15 UTC
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.
Comment 2 Gabriel Wicke 2013-06-24 20:03:31 UTC
*** Bug 50035 has been marked as a duplicate of this bug. ***
Comment 3 Andre Klapper 2013-07-04 10:35:17 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]
Comment 4 Gabriel Wicke 2013-07-12 01:02:50 UTC
*** Bug 51039 has been marked as a duplicate of this bug. ***
Comment 5 James Forrester 2013-07-12 16:22:07 UTC
*** Bug 51244 has been marked as a duplicate of this bug. ***
Comment 6 James Forrester 2013-07-12 16:22:36 UTC
Another example from bug 51244 - http://parsoid.wmflabs.org/pt/Usu%C3%A1rio:Helder.wiki/Testes?oldid=36380720
Comment 7 James Forrester 2013-07-15 01:43:22 UTC
*** Bug 50290 has been marked as a duplicate of this bug. ***
Comment 8 Gabriel Wicke 2013-07-17 15:28:25 UTC
*** Bug 51535 has been marked as a duplicate of this bug. ***
Comment 9 Gabriel Wicke 2013-07-17 15:39:34 UTC
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.
Comment 10 Gabriel Wicke 2013-07-18 00:14:24 UTC
Spec in development at http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Error_handling
Comment 11 James Forrester 2013-07-18 15:35:31 UTC
*** Bug 51615 has been marked as a duplicate of this bug. ***
Comment 12 ssastry 2014-09-25 14:18:15 UTC
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.
Comment 13 Gerrit Notification Bot 2014-10-31 22:48:18 UTC
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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links