B2G2, a brain dump about Firefox OS and Geeksphone's Peak

Updates? Check Now!

Stability vs living on the edge used to be a hard decision to make. The decrease in development iteration time pioneered by Chrome and mimicked by Firefox proved to be a plausible answer to this dilemma. It's also one of the fundamental conditions to avoid version fragmentation.

With a new product release scheduled every 6 weeks and incubation phases as long for alpha and beta stages, developers can quickly get cool APIs or improvements to play without sensible troubles for the end users. Despite being in its 1.0.x at the time of writing, Firefox OS has not been unleashed in the wild yet.

This preparation period before the storm is a bit disturbing. On one side, commits are raining on the Gaia's Github repository at a tremendous rhythm. On the other side of the fence everything's still quite. The built-in delivery mechanism on my Peaky repeats the same "Your system is up to date" litany day after day without even blinking.

I was expecting these preview devices graciously made available by Geeksphone to have some kind of hot-link to the upstream source. Like a direct connection to the nightly channel with a handy option to fetch the new code over the WiFi easily instead of regular flashing steps through USB.

Let's have a closer look of what's being checked when navigating to the Settings > Device Information > Software updates section. The relevant javascript chunks are located in this about.js file.

First there's an XHR call to retrieve the Gaia git commit hash. It populates the screen with a value stored in resources/gaia_commit.txt, so no server request here.

What about the last update date? This case is a bit different. It calls the Settings Manager Web API to grab a key after locking it as described here. I'll have to dig further to understand where the values are really stored but it looks like some kind of KeyValues LocalStorage.

Last chance: the checkUpdate method. Again it uses the Settings Manager with callbacks to retrieve our response. So is this new API capable of querying remote servers? There's definitely a huge part to learn here about the global architecture and it will serve as a perfect basis for a nice exploration in a next post.