Weather information about errors. The weather lingers for several days in different places and the weather changes

When I started looking for weather using the relatively new Snapshot API, I was a little puzzled / worried when I couldn’t find any timestamp on the results being returned.

I implemented using the API, and everything seemed fine for a while. However, now I get the same Weather data as four days in three different places. And the conditions and temperature really were not the same in real life (and the other device gave out different (correct) data).

If you trust the API to provide you with snapshot data without a timestamp or location or anything you really need to trust the returned data.

Is this a known issue for the Snapshot API? Is there any way to avoid this situation? How can you recover when the weather gets stuck like that? And is there a way to find out the age and / or location of the returned data?

I debugged this device and saw that this is not application caching, but WeatherResult has a success status.

+5
source share
1 answer

The API documentation says that weather snapshots return to the current location of the device. After checking it, the weather is definitely updated if the location changes or every few hours (as opposed to a known problem).

About the second question, if the caller needs to know the location, there is a separate getLocation () API that gives this information.

If β€œstuck” means that weather data never changes, it will be useful to find out more about the waiting period or distance traveled.

0
source

Source: https://habr.com/ru/post/1257975/


All Articles