Page MenuHomePhabricator

[stub] Serve formatted error message image when mapdata cannot be found
Closed, DeclinedPublic

Description

Currently, historical maps are rendered as a blank static thumbnail. Instead, we should render an error message that's readable regardless of the thumbnail size, and explains how versioned maps aren't supported yet.

This is to support a potential rollback in case we need to disable versioned maps after deployment.

Event Timeline

awight renamed this task from [stub] Service formatted error message image when mapdata cannot be found to [stub] Serve formatted error message image when mapdata cannot be found.Apr 28 2022, 10:12 AM

A detail worth noting: in the error case we're looking at here, the current behavior is to still draw a map of the area requested, just without any of the geoshapes and markers overlaid. For example:
https://maps.wikimedia.org/img/osm-intl,6,53.383333,-1.466667,300x400.png?lang=en&domain=en.wikipedia.org&title=Downton+Abbey&groups=_39680418b083bf0edb91278ce24d9075eb0496fa

bad-map.png (400×300 px, 39 KB)

The node-mapnik Image.fromSVG function doesn't support the <text> element, so we'll probably have to go with a PNG, or get tricky and render the error as a GeoJSON overlay.

Change 787687 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/services/kartotherian@master] [POC] Show mapdata error in static thumbnail

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

A detail worth noting: in the error case we're looking at here, the current behavior is to still draw a map of the area requested, just without any of the geoshapes and markers overlaid. For example:

I feel like this significantly changes the error we need to show.

Can you detail all the times/reasons this error would be shown? And in all of these there would still be a map?
I feel like an error under the map in that case makes the most sense, not a png within the empty frame

Ideas from dev chat:

Can you detail all the times/reasons this error would be shown?

The specific error that we're intercepting here is a failure to retrieve GeoJSON from the wiki for an article. Here are the potential causes that I can imagine:

  • Map is from an outdated page revision, and the versioned maps feature is disabled or broken. (Our main use case for the error image)
  • Map is from the latest page revision but a request was made too early. (This should be impossible now, but has been a bug in the past and might regress. Condition would persist for ~15 minutes.)
  • Corrupted image URL. (Unlikely)
  • Connectivity is broken between kartotherian and MediaWiki. (Extremely unlikely)
  • Page was deleted. (Requires that the static image link is being used on its own, extremely unlikely.)

And in all of these there would still be a map?

Yes, they would always include the coordinates and zoom level because these are in the image GET request.

I feel like an error under the map in that case makes the most sense, not a png within the empty frame

Sounds good. I'm not sure about adding anything to the interface outside of the image, or changing image size, but what do you think about overlaying the error message to the *bottom* of the existing map image? For example:

bad map 2.png (398×301 px, 102 KB)

Technically, I think it's very difficult to pass information about these failures back to MediaWiki.

Ideally, I would follow Rita's designs here, but with the most up-to-date OOUI message design. I can make new mocks, but would like to confirm if going in this direction can even work.

  • The open questions then are:

    • Wording: Thanks for the list of situations. In all these situations, the geoJSON doesn't load but the background does? So can we say something like "Not all map data can currently load." I think I would need to discuss the situations more to understand if we can say anything more specific.
    • How to generate the message: It's true that it needs to be translated, so creating a png will not work. Is this something that can be generated dynamically and overlaid?
    ECohen_WMDE closed this task as Declined.EditedMay 5 2022, 2:02 PM

    We said this was a nice to have and will not pursue it further at the moment. There does not seem to be a feasible way of doing this which meets the constraints of both served as svg and translatable.

    Change 787687 abandoned by Awight:

    [mediawiki/services/kartotherian@master] [POC] Show mapdata error in static thumbnail

    Reason:

    Probably won't use this approach.

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