The Fourth Answer to Offline

Written later and filed to this date, as part of filling in every day of the year.

The torrent client on my glasses has a header line that, when things go wrong, reads something like ○ offline (auth?). The word in the brackets is a guess at which hop failed, and on a display a few lines tall with no keyboard, the guess is most of the diagnosis. A wrong URL shows as refused. A bad token shows as auth?. The always-on box asleep shows as timeout. Until then, those were the three answers.

The fourth failure had no word. The client talks to a small API, and the API talks to the download daemon behind it. When the daemon hangs, the API, which had just learned to bound its own calls, answers with a 502 and a body saying the daemon timed out after so many milliseconds. The client read that body, found the words “timed out”, and classified the failure as its own timeout. The header blamed the client-to-API hop, the one hop in the chain that had demonstrably worked, because an HTTP status had come back over it.

That is the whole fix, and it is an ordering: check for a status before checking for timeout words. A status proves the first hop completed, so any timeout language after it describes somebody else’s upstream. The client’s own failures never carry a status, so they still fall through to the old branch. 401 and 403 keep auth?, 502 becomes qbt?, with the question mark kept on purpose: the status names a prime suspect, not a verdict.

The ordering bug is the interesting part because it is a bug in reading, not in transport. Both hops can say “timed out”. Only one of them can say it with a status code attached, and the status is the stronger evidence, so it has to be read first or the weaker evidence wins by arriving earlier in the function.

Offline hint (n.): the one-word guess in a glanceable display’s offline header at which hop in the chain failed, inferred from the shape of the error rather than reported by anything that knows. The rule for inferring it: evidence that proves a hop worked outranks words that merely mention failure, and gets read first.


← all writing