GNOME Bugzilla – Bug 737179
Guard against invalid forecast entries
Last modified: 2021-07-05 10:59:30 UTC
Created attachment 286872 [details] Bug in the weather extension While debugging a bug in the weather extension [1] (see screenshot), I realized that some of the entries returned by gweather_info_get_forecast_list can be invalid, and their validity should be checked using gweather_info_get_value_update Although I have not been able to reproduce this bug in gnome-weather, it might be a good idea to guard against this anyway. [1] https://extensions.gnome.org/extension/613/weather/
Created attachment 286873 [details] [review] Guard against invalid forecast entries
Actually, now that I am trying out 3.13.x/3.14, I see that the weekly forecast looks broken without this patch. Obviously that did not affect older versions because the weekly forecast was limited.
Created attachment 286874 [details] Screenshot of broken weekly forecast
Created attachment 286875 [details] Screenshot of correct weekly forecast
I found the following cities to be affected today: Berlin, Helsinki, Stockholm, Hamburg, Prague, Brno The list can change from one day to another because this depends on what we are getting from the server.
Mh... do you have an example of the specific XML returned by the server when the bug occurs?
No, I don't, but it should be easy to get it today for one of those cities. But what is the history behind the gboolean returned by gweather_info_get_value_update ?
Historical, mostly. The value is guaranteed to be == get_valid (), which is also guaranteed to be true for slave infos (ie, those obtained by get_forecast_list (), but not those created by hand). It's also a matter of consistency with other get_value_*, which can fail for more reasons.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-weather/-/issues/ Thank you for your understanding and your help.