At 13:08 on Thursday I added a third row to a page a client signs into. At 14:47 I fixed what that row broke. Between those two times the page loaded, the first two rows worked, and everything below the third row in the script never ran.
The page is the onboarding app at hub.3archai.com. A person signs in and it walks them through what's theirs to do: the domain, two platform accounts with a key to paste, and the machine on our network. Three cards, one column, in that order.
Three cards, two forms
The first two are key cards. Each holds a form, an input, a Test button and a Remove button, because each needs a secret typed into it. The third is a status card: no form, no input, nothing to type. It reports whether the machine is on our network, and it asks again every fifteen seconds.
All three carry the same class name. One loop binds them: find the form inside the card, attach the save, test and remove handlers, then add the folding behaviour that turns a saved card into a heading and a status line.
What the loop assumed
- that every card of this class contains a form;
- that the form holds a submit button, a text input and a notice line;
- that the card can be folded and opened by tapping its heading.
All three were true when I wrote it. There were two cards and both were key cards. On Thursday at 13:08 I added the third, a status card, with the same class and no form. The assumption went false, the loop reached that card third, called a method on nothing, and threw.
What one thrown line costs
The error didn't cost the card. It cost the module. Everything written below that loop in the same file stopped: the poll that asks whether the machine is on the network, the call that loads the person's name, their saved keys, their setup steps, their domain record, and the boot call that fills the page in. None of it ran: what you saw was the HTML, not the app. The order of statements decided which half of the app survived.
What a person saw was a page that mostly worked. Two key cards that saved when you pasted a key. A greeting that stayed generic. A third row saying Checking and going on saying it, because the word was in the HTML and the code that would have changed it was below the crash.
No error banner, no blank screen. One line in a console nobody had open. A static label doing an impression of a live one is the only visible trace, and it looks exactly like patience.
The fix, and the rule underneath
The fix is a guard: if this card has no form, leave it alone and return. One line, at 14:47. It buys back the page.
The rule under it is the part worth keeping. A loop over "the things on this page" is a promise that every one of them has the same shape. That promise holds until the page grows a member of a different shape, and then it's a bug written months earlier that fires the day you add a feature.
There's a second fix I haven't made. The page's boot call shouldn't sit at the bottom of the same uninterrupted script as the per-card wiring. Until it moves, every card is a single point of failure for the whole page. I'd rather write that down than let the guard imply the page is now safe.
What the transfer button asks first
By 16:57 the same page had a Transfer complete button. It asks two questions before it writes anything. Is your domain at Domains.co.za, yes or no. Yes opens a short list of permissions the client ticks on their own screen. No opens a request for the name of whoever bills them.
Neither path asks for a password. Delegated access is a permission a client can revoke from their own screen, without telling us. A password is a secret they can't take back, and a supplier who asks for it wants something they don't need.
Where it stops
One guard isn't a test. Nothing on that page would've told me it had stopped halfway. I found it by reading the file after the fact, not because a check failed or a person complained. A deploy that passes on a healthy response and a screenshot is the same lie as a release gate that records missing proof as a pass.
I'd tell a client not to buy if their supplier's idea of "it works" is a page that renders, and if the number of things that must be true for that page to work is more than they can count on one hand.
If you want to see what we check before a client's first sign-in, including the parts that fail, that's most of the two-hour conversation.
Questions answered
What actually broke?
A loop that wired every card on the page assumed each card had a form. The new status card didn't, the loop threw, and every statement after it in the same file never ran.
How long was it live?
From 13:08 to 14:47, ninety-nine minutes, with two of the three cards working throughout, which is why it looked fine.
What would have caught it sooner?
A page-level check that fails when a script stops halfway. There isn't one yet; I found this by reading the file, not by a test.