What broke
The outage alert was too long to be delivered
On 13 November the stock app's broker login failed after a restart because a dependency update had changed the embedded browser version. The push alert about the failure was rejected with HTTP 413 because it carried the full browser log. The fix: the app now installs the right browser itself, and push alerts carry a short excerpt.
The short version
What went wrongAfter a restart, broker login failed on a browser version mismatch, and the push alert about it was rejected with HTTP 413 because it carried the full browser log, over 4 KB.
How we found itThe notification list showed the push marked not delivered, and the log showed HTTP 413 with the subscription kept. The alert code had only worked for short messages.
The rule nowA channel is not proven because a short message got through. Test it with the largest message it can be given. Push bodies are now cut to an excerpt, and the browser installs itself.
This post documents something Claude got wrong. The claim rests on a commit or a file, not on memory. All of Claude's mistakes
On the morning of 13 November the stock app was down for about two and a half hours, from 07:21 to 09:43. The outage itself was simple: the host was shut down cleanly from the Start menu. There was no crash. When the machine booted again at 09:43, all five services came back up by themselves.
Two silent faults only showed up because of that restart. The automatic login to the broker failed. Then the alert meant to tell Henning about it never reached his phone, because the alert was too large to send.
What was lost in the window
The app’s own notes list the cost. Market snapshots from 07:30 to 09:30 are missing, and that intraday gap cannot be fetched again. The 07:45 morning report did not run. The live trading cycles at 09:00 and 09:30 and the simulation cycles at 09:05 and 09:35 were skipped, so nothing was traded in Oslo or Europe during the first hour and a half. The next cycle catches up on that.
The morning report was produced afterwards, around 09:52. Its push notification did not go out, because the command-line tool used to rebuild it does not set up push. The report was still there in the app.
Fault 1: the browser no longer matched
The stock app logs in to the broker on its own by driving a headless browser through Playwright. The broker’s refresh token runs out if the app is down for more than about 40 minutes. That is a known class of problem, and the automatic login exists to recover from it. On this day the token expired at 08:19, while the machine was off.
When the app came back, the automatic login failed at startup. The browser build it looked for, 1248, was not installed. A dependency update had moved playwright-core to version 1.64.1, which expects headless shell build 1248. The installed browser folder still had build 1243.
There is a fallback that tries Edge instead, but it does not work when the app runs as a system service. We had known that since 3 October. So nothing was left to log in with.
None of this was visible while the app kept running. The mismatch only mattered the first time a new login was needed after the update, and the restart was that first time.
The immediate fix was manual. We installed the right browser build and ran the login again at 09:51, and the chain of trading jobs was back.
Fault 2: the alert was rejected
The app did notice that the login had failed, and it tried to tell Henning. The alert was stored in the app’s notification list. In the delivery field the push was marked as not delivered, and the log said the push had failed with HTTP 413 and that the subscription was kept.
HTTP 413 means the payload was too large. The function that sends admin alerts put the entire message text into the push body, and this message carried the full Playwright error log, more than 4 KB. Push services reject payloads above about 4 KB. Claude wrote that alert code, and it worked fine for every short message. The alert path was healthy, but only for short messages.
The failure note in the repository puts it plainly: the long error messages are the ones that need the alert most. A one-line price warning arrives without trouble. A full stack of browser output explaining why the login broke does not.
We already had a failure class for alerts that share fate with the thing they watch. Until now that meant infrastructure: if the server is down, it cannot alert anyone that it is down. This one was new. Nothing in the infrastructure was broken. The size of the error itself made the alert undeliverable.
The fix, in two parts
Both fixes were in one commit on 13 November, and the deploy was scheduled for 22:30 that evening, after the US market closed.
The browser installs itself. When the automatic login tries to start the browser and gets the error saying the executable does not exist, it now runs Playwright’s own installer for the headless shell that matches its playwright-core version. Then it tries again. The download is about 2 MB and only happens when it is needed, with a five-minute time limit. If the self-install fails, the login falls back to the old path and the failure is logged. The broker login notes now record that a playwright-core update arrived without anyone installing the matching browser.
Push alerts carry an excerpt. Every push body now goes through a small function that leaves short texts alone and cuts anything longer than 600 characters, ending with “… (full text in the app)”. Titles are cut to 120 characters. The limit is counted in characters with a wide margin, because UTF-8 and the encryption of push payloads both add bytes. The full text is still stored in the app’s notification list, and tapping the alert opens it there. The cut applies to both places in the code that send pushes: admin alerts and the ordinary market alerts.
A new test checks three things: short texts are left as they are, a 5,000-character text is cut below the limit and ends with the pointer to the app, and a whole push message built from 3,000 repetitions of “æøå” stays under 3,000 bytes. That last case matters because Norwegian letters take two bytes each in UTF-8. A limit counted in characters could otherwise give a false sense of safety.
The user-facing changelog sums it up in two lines. After the outage the app could not log in to the broker because an update had changed the version of its embedded browser, and it now fetches the right browser itself. Long alerts never reached the phone because the push service rejected them as too large. That hit exactly the error messages Henning needed, and now he gets a short excerpt with the full text in the app.
How to catch it next time
The failure note includes a detection query: list every admin notification from the last 30 days that was not delivered by push, with its title and body length. On 13 November that list would have shown the login failure sitting there, undelivered, with a long body. The alert existed. It just never left the server.
The rule
A channel is not proven because a short message got through. Test it with the largest message it can be given.