Home All posts →

PocketBill Blog

The Green Light That Meant Nothing

Published 2026-10-17 · PocketBill team

One status flag, set in the wrong place, turned a broken quote feed into a confident green dot. On why PocketBill has no connection light to lie with.

The screen that agreed with itself

For four days my trading dashboard told me everything was fine. The brokerage row said Connected, in the same calm grey it always used. The positions were all there — every ticker, every share count, exactly right. The only thing wrong was that every price read 0.00, which made every market value zero, which made every gain and loss zero.

Nothing on that screen was lying on purpose. It just had no idea it was broken.

I build PocketBill, a subscription and spending tracker that keeps everything on your device and never needs an account. It has no connection light, because it has nothing to connect to. That is not a design philosophy I arrived at by reading about local-first software. It is what four days of a green dot taught me.

The flag was set too early

The adapter starts two things: a trading context and a quote context. The code created both, then set a single flag — connected — and the flag was set regardless of whether either one had actually come up. The quote context failed. It failed quietly, because failing quietly is what a try/except does when the except branch only prints.

So the sequence was: quote context dies, the flag still goes green, the UI reads the flag, and every later price request checks for the quote context, finds nothing, and returns an empty answer. Empty becomes zero. Zero becomes a chart that draws a flat line and looks like a calm market.

It cleared up on a restart, which is the worst possible symptom. A bug you can restart away is a bug you will restart away for a month before you look at it.

A status should describe a capability, not an intention

The fix was three small pieces. Before each price request, check whether the quote context exists; if not, try to build it again, up to three times. If a request throws, clear the context so the next request gets a fresh attempt. And count the attempts, so a genuinely dead connection stops hammering and waits for a human.

The real change was smaller than any of that, though. The flag now means prices work, not I tried to start prices. Those two sentences look identical in a diff and behave nothing alike at 9:30 in the morning.

Nothing to be green about

PocketBill has one status: whether your records are on this device. That is not a connection, so it cannot half-succeed. There is no window where the app looks fine and the numbers underneath are placeholder zeroes, because there is no second machine holding the real ones.

I still like the green dot. I just want it to mean something the moment I see it.

debuggingstate managementlocal-firstindie devtrading
Track it once, see it forever.
Add your first subscription or expense in PocketBill — no account required.