Page MenuHomePhabricator

Mapdata library should not change structure of GeoJSON
Closed, ResolvedPublic

Description

Background: The mapdata library is a client to the MediaWiki Action API "mapdata" query. The Kartographer extension and kartotherian service consume this library. As a courtesy, the getter recursively fetches and substitutes "ExternalData", GeoJSON retrieved in additional HTTP requests. This recursion only goes one level down.

Problem: mapdata pulls the external data fragments out of their GeoJSON hierarchy and up to the top level of the internal result list, as a way of making the Promises easier to manage and parallelize. This is unexpected and unwieldy for external scripts to handle, for example when the interface wants to list all groups or hide a group that contains external data.

Suggestion: Expand mapdata in-place in the hierarchy. Keep the requests parallelized. This matches behavior of the new parse-time geoshape expansion.

Event Timeline

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

[mapdata@master] Expand external data in-place

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

Moving to review so that we discuss the potential changes before integrating into Kartographer.

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

[mapdata@master] Test mixed inline and external data

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

Change 887984 merged by jenkins-bot:

[mapdata@master] Test mixed inline and external data

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

Change 889165 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mapdata@master] Rename variables for code clarity

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

Change 889167 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mapdata@master] Simplify DataManager/ExternalDataParser to not be classes

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

Change 889165 merged by jenkins-bot:

[mapdata@master] Rename variables for code clarity

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

Change 889167 merged by jenkins-bot:

[mapdata@master] Simplify DataManager/ExternalDataParser to not be classes

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

Change 889538 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mapdata@master] Simplify signature of methods processing group.geoJSON

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

Change 889538 merged by jenkins-bot:

[mapdata@master] Simplify signature of methods processing group.geoJSON

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

Change 887772 merged by jenkins-bot:

[mapdata@master] Expand external data in-place

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