Blog · BrowserBox

Three releases in nine hours

· DOSAYGO

BrowserBox 21.0.0 went public on 23 November at 07:46 UTC. By 16:49 UTC the same day the latest release was 21.0.2. This is what happened in between.

Version 21 added a setting we had wanted for a long time. BrowserBox normally starts its own Chrome and streams it to you. With BBX_ADOPT_CDP_PORT it attaches to a Chrome that is already running, so a browser you signed in to by hand can be handed to a remote viewer. You give it the port once and it is saved in the config file with the rest of your settings.

The release candidate passed every lane of our release pipeline on macOS, Windows and Linux. Every lane was a clean install on a fresh machine.

The first failure

Within half an hour of the release we ran bbx start on one of our own Macs with the new version. It refused: adopted DevTools endpoint unavailable.

That Mac had been used to test adoption before the release. The port was still saved in its config file and the Chrome it pointed to was long gone. 21.0.0 read the saved port as a requirement, so with no browser on that port there was no start.

No clean install could have caught it. The bug needed a setting left behind by earlier use, and a fresh CI machine has no past.

The quick fix was to clear the setting during setup, or tell people to unset it in the shell. We threw both out. The saved value is what the operator wrote, and we do not delete it behind their back so that our start succeeds. The rule we took is an old one from network protocols: be liberal in what you accept and conservative in what you emit. A stale or nonsense setting never stops setup or start. BrowserBox says on stderr what it found and what it is doing about it, then launches its own browser. The saved value stays in the file.

Before shipping the patch we slowed down and had everything that changed since 20.9.0 reviewed for mistakes of the same kind. The review came back with eleven findings in the code around adoption, and the release candidate turned up two more. One of the eleven: bbx stop on Windows could close a browser it had only adopted, and that browser is yours. One finding we closed without changing anything. If you kill -9 BrowserBox's main process, it does not come back by itself, and we decided not to promise that it will.

21.0.1 was public at 12:13 UTC.

The second failure

The 21.0.1 review left one limit on the record. After an upgrade, a Chrome started by the old version could still be running, and the new version had no proof that BrowserBox had started it. It could be a browser the user launched. The safe choice was to leave it alone.

Then we upgraded a machine where exactly that had happened. The old Chrome was still running and still holding the port. 21.0.1 left it alone, as designed, and could not start. The limit we had written down that morning was now the bug.

The second decision was about whose browser it is. BrowserBox keeps a private browser profile that nothing else has a reason to use. A Chrome running on that profile at BrowserBox's port is ours, with or without a record of who started it, and start now cleans it up. A profile you supplied yourself gets the opposite treatment: BrowserBox closes a browser there only when it can prove it launched it. If some other program is holding the port, BrowserBox leaves it running, names it in a notice and starts its browser on a free port.

The other startup settings got the same treatment in the same pass. A wrong value for the tab limit or the idle timeout now gets a notice and the default. Some settings still refuse on purpose. A bad profile directory stops the start, because guessing another one could open someone else's session. A bad Tor proxy stops it, because falling back to a direct connection would send your traffic outside Tor.

Two candidates for 21.0.2 failed in the Windows lane, and both failures were in the test code. The third passed all 18 lanes on the first attempt. A green pipeline had not saved 21.0.0, so this time we did one more thing before promoting it. On a Mac we installed the previous release, started it, upgraded to the candidate, restarted and logged in. We ran that for the clean path, for a browser left over from 21.0.0, for a machine stuck on 21.0.1, for nonsense settings and for a stranger's browser sitting on our port. All of them passed, and 21.0.2 was public at 16:49 UTC.

What it does now

bbx start starts. A setting that points at nothing gets one line on stderr and a working default. A browser left behind by an older version is closed if it is ours and left running if it is yours. Every release now gets the upgrade run on a real machine, with the previous version's state still on it, before it is promoted.

Evaluate BrowserBox on your own server

← All posts