Page MenuHomePhabricator

jsondata API endpoint caches Data:.map's for 24 hours and does not purge on edit
Open, LowPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • empty data attribute. all geojson is missing

What should have happened instead?:
the coordinates should have been in the json output.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
First suspicion was that the validation rules do not allow for optional elevation (the third number in a coordinate pair in geojson).

When I removed the elevation information
https://commons.wikimedia.org/w/index.php?title=Data:Route_through_the_landscape_of_cultural_interest_of_Vélez-Blanco.map&oldid=815098976
The api call did report the correct jsondata temporarily. afterwards it flipped back to being without data.

Later testing
Every time I purge the Commons page, the jsondata is correct for 10 seconds and then returns to being empty. This is only when I make the request logged in, logged out, the contents stay the same. But it uses origin=*, so that should drop us to anonymous context, so it doesn't really make sense..

Confirmed this is definitely due to the 24 hour caching being applied by the jsondata endpoint and it seems that this doesn't implement purging correctly. The initial map has no data, and the report was made within 24 hour of that initial upload.

Event Timeline

What exactly is not working on Wikidata as expected? Where is this jsondata query used? Is there an example page?

If I make a query (https://w.wiki/7to4), relying on P3896 statement in Q123002533 item, then for me this mapdata is retrieved using the following API link: https://commons.wikimedia.org/w/api.php?format=json&action=query&titles=Data%3ARoute%20through%20the%20landscape%20of%20cultural%20interest%20of%20V%C3%A9lez-Blanco.map&prop=revisions&rvprop=content&origin=*&maxage=3600

TheDJ updated the task description. (Show Details)

So by "fails" you mean that mapdata isn't diplayed on a map next to Commons link in this Wikidata item page? To me it seems that item pages just aren't set to display this data (using mapframe or otherwise). If I'm not missing something in browser console then it doesn't try to load respective jsondata on this page nor on any other item page with P3896 statement.

Technically, User:Teester/ClaimMaps.js probably shouldn't be using jsondata to access the geojson, but action=query with prop mapdata. regardless, this does not explain why the endpoint was not returning the data, and why after purging it temporarily did before reverting back to missing it.

It now does seem cleared up. So perhaps it's a cache problem inside jsonconfig extension or something (which powers the Data namespace and the action=jsondata endpoint)

A working example is https://www.wikidata.org/wiki/Q122936541#P3896

Comparing the json data for this to that of original example I noted the latter for some reason had a capitalized "Name" property name (fixed here). Maybe this made it invalid?

Well, let's undone the change and wait for a day to see if the issue 'spontaneously' comes back and if not, then my other two changes. I guess then will give us our answer. Waiting a day is important, as that is the max cache time that is used in any of the chains.

Update: It was not the Name property. Gonna test now if it was the altitude or the other change

Update: It was not the Name property. Gonna test now if it was the altitude or the other change

Looks like it wasn't the altitude data either. And it probably wasn't the previous removal of properties either as we have another working example with exactly the same properties.

I now notice that the initial revision of this page was submitted with an empty data attribute. This is exactly what you received earlier, right? So most likely this bad revision was still cached at the time.

TheDJ renamed this task from geoshape not working on wikidata, but works on commons to jsondata API endpoint caches Data:.map's for 24 hours and does not purge on edit.Nov 1 2023, 2:45 PM
TheDJ triaged this task as Low priority.
TheDJ edited projects, added JsonConfig, Maps; removed Maps (Kartographer).
TheDJ updated the task description. (Show Details)
TheDJ updated the task description. (Show Details)