The Case of the 60-Second Black Screen

November 15, 2026

“The board works fine on the desktop. On the phone it goes black about a minute after login, and no key does anything until I reconnect.”

That report sounds like flaky Wi-Fi. It was an armed timer.

The shape of the crime

First suspect: the idle-timeout enforcer — obviously, something that fires after inactivity. We went straight to its code, and… the guard was already correct. idleMinutes >= -1 looked like an instant breach on a skim, but the enforcer treats negative limits as “never disconnect”, honors them explicitly, and the UI even labels the field that way. Theory retracted. We had to keep digging — this post is honest about the detour because the detour was the method.

The real trail came from the log timeline. Phosphor sessions persist — disconnect and your board parks, resuming where you left it (the tmux-for-your-BBS design). At 21:24:53 the phone’s token channel attached a fresh session — [SESSION-REATTACH] FRESH session, logged to the second.

At 21:25:53 — exactly 60.000 seconds later — the GUI stopped.

A round number that exact isn’t a network event. It’s a scheduler. And login-timeout is armed at 60 seconds.

How a login timer kills an authenticated session

What the token path didn’t show: a second login surface, on the same screen stack, still armed with its own countdown. Logins don’t all complete the same way — when the device-token handshake bound the session, the timer surface had no way to know. Its own notion of “this login” never completed. At sixty seconds it fired its disconnect — a shared-GUI stop on a session that was already someone’s working board. Black screen, dead keys, and reattach-on-reconnect looked like the fix for an attack that was actually friendly fire.

Three fixes, not one

The first fix is the law: a login timeout must never fire on any authenticated session, from any surface. When a login timer fires, it now checks whether the session has a bound identity; if it does, the fire is logged ([LOGIN-TIMEOUT] stale timer ignored …) and ignored — the backstop branch, because a timer should be disarmed, not merely defeated.

Which is the second fix’s territory: timers are disarmed at the moment a session becomes authenticated, so the stale case becomes rare rather than merely survivable. The third is truthfulness: the unauthenticated branch still disconnects, but it says so — “no login within the configured window” — with its own log marker. A silent disconnect leaves zero forensics; this incident was only solvable because something left a trace. Now everything does. Fifty law tests pin all of it in LoginScreenTest.

The client-side half: reconnect, politely

The server side was fixed, but the phone-side had its own lurking failure mode: an auto-reconnect loop with no memory. A server down for a night could invite an infinite retry storm — reconnecting over and over, forever, at network speeds.

So the iOS client got a bounded policy:

  • Three attempts per episode, backing off 2s → 8s → 15s, then a give-up latch and a clear “offline” state.
  • Resets happen only on wins: you connect manually, you foreground the app, or the connection survives ≥60 seconds (stable = real).
  • It never retries after a manual disconnect or an auth failure — those are answers, not outages.
  • While it works, the terminal says so: “Reconnecting (1/3)…” instead of a silent pause.

Both halves shipped in v1.0.3 of the Phosphor server app (notarized DMG, jterm c299ebd / jterm-bbs 557ba1a2) — the same release that carries the connection pool fix from the earlier wave.

The general lesson

Two, and we wrote them on the wall:

  1. A timeout is not a state machine. A login timer armed by surface A can be obsolete the moment surface B completes the login. Guard the session’s actual state at fire time — never trust the timer’s own idea of how the session got somewhere.
  2. Every disconnect path must log its fire. The only reason this bug fell at all was one round number in one timeline. The new guard logs both branches; the next archaeologist won’t need the lucky number.

Where to go next: the cursor-anchor law is its sibling in the forensics genre — and the fake user that now runs these surfaces in tests is its own post.