GNOME Maps and GNOME Weather have both recently had bad luck with online service providers who either discontinue or change data APIs with crippling results for their users. Maybe it’s time to acknowledge that APIs are unstable and unreliable, and build for an expectation of failure instead.

Just six weeks ago, GNOME Maps could no longer display any maps as the online service that provided the mapping service shut down their free service offering. This left GNOME users with a useless mapping application that had no fallback data source.

Earlier this week, GNOME Weather was hit with a similar issue when the National Oceanic and Atmospheric Administration of the United States (NOAA) shut down a weather API critical to GNOME Weather. According to details published on the NOAA website, the METAR API endpoint that GNOME Weather depended on was discontinued some four years ago and shut down completely this week. With four years' notice, someone should probably have noticed something a bit earlier.

A few months ago, the Norwegian Meteorological Institute (MET Norway) quickly update libgweather to avoid any service outage.

The GNOME bug tracking this issue has already received a patch, but it can take months and even years before all users of all the various Linux distributions will receive this update. As a nice compensation, the new API endpoint will offer increased protection and privacy with added HTTPS encryption.

I made changes to this API endpoint only four months ago to remove unnecessary redirects in the affected API endpoint from NOAA. Interestingly enough, there weren’t any redirects from the weather.noaa.gov endpoint to the new www.aviationweather.org endpoint at that time. Nor were there any notices about changes. I did spend a fair amount of time looking for information about service changes as I was hoping to find an alternative HTTPS-capable endpoint.

This does serve as a reminder to every developer out there that they need to be proactive about monitoring all the various APIs that their apps rely on. Leaving users with a dead data endpoint and no quick way to deploy updates is a very unfortunate situation.

I live outside the United States and outside the area serviced by NOAA. In Norway, where GNOME Weather gets its data from the MET Norway, GNOME Weather was also unavailable. This is a bit silly as the data from NOAA have historically been discarded immediately in favor of the MET Norway data, but both APIs were required for the app to function.

GNOME Maps and Weather were clearly not built for failure. When the APIs they depended on disappeared, users were left with a completely useless app. GNOME Weather does fetch forecast data until a few days in the future, and this data could have been cached and displayed along with a warning about it being slightly out of date in case the user’s device is offline or the API was unavailable. This would have helped provide users with a better experience than just stating that the “Forecast is unavailable”.

There are multiple weather data service providers built into GNOME Weather, but the app isn’t built to take advantage of that. It could have used a lower resolution/fallback provider when the primary provider was unavailable. For example, MET Norway provides free weather data for the majority of the planet.

The most important job for any app to fulfill is to complete the task the user expects it to perform. A map app must display maps, a weather app must provide weather information. It doesn’t necessarily mean that the app itself has to provide this information. If all else fails and service providers become unavailable, it’s better to link out to a location on the web that can help the user. The user will still be able to complete the task she wanted to be done even if the app itself wasn’t able to complete it.

Imagine if the GNOME Maps app had displayed a list of links to the device’s location on OpenStreetMap, Bing Maps, or Google Maps on the web rather than just displaying a location marker in an empty map. Likewise, GNOME Weather could have linked to various online weather services. The list of service providers could be randomized to avoid any claims of commercial interests or favoritism among the service providers.

I hope we’ll see more robust and fault-tolerant apps from GNOME in the future. The way their online apps now break regularly isn’t very confidence-inspiring for users.