26 accounts were broken and nothing told me
Nine commits in October, nearly all of them about one bug that had been running for months.
EchoQuest logins resolve to a canonical EchoForge account — one identity across the arcade, the accounts service and the game, so entitlements and premium status follow you around. That went in over the summer during the account centralization work.
It covered the OAuth paths. It didn’t cover /register.
So every plain email-and-password sign-up since then created a game user and no canonical link. By the time I found it there were 26 production accounts in that state and the number was going up. Nothing errored, nothing logged a warning. The sign-up worked, the player played, and the row tying them to everything else just wasn’t there.
That’s the part I keep thinking about. A loud failure gets fixed the day it ships. This one had no symptom at all until something downstream needed the link, and downstream was a feature I hadn’t written yet. It was sitting there waiting for me to come looking.
I needed three goes at the fix
/register writes the link row in the same transaction as the user insert now, so you get both or neither. /verify-email picks up the strays — collision cases, and anyone who registered before the link existed — and its insert is self-healing, so running it twice does no harm.
Review caught two things I’d missed. One write was escaping the transaction and going out on the connection pool instead of the transaction’s client, which defeats the whole point of putting it in a transaction. And the strays logic did a SELECT and then an INSERT against a unique column, which two simultaneous registrations would turn into a 500.
Both got found by reading the diff after it had already merged, not before. The thing I was fixing was “writes that should be atomic aren’t,” and my fix contained a write that wasn’t atomic.
A directory that doesn’t exist
The rest of October went on four tests that only failed on CI. Never locally. Same code, same commit, green on my machine and red on the runner.
The runners are self-hosted Windows boxes and the runner service runs as NETWORK SERVICE, whose temp directory resolves to an 8.3 short path with a tilde in it, like SERVIC~1. Node’s pathToFileURL() does the right thing and percent-encodes the tilde. Then vite-node resolves that file: URL by stripping the scheme off the front without decoding what’s left, so Vite went looking for a directory literally called SERVIC%7E1, which doesn’t exist and never will.
I reproduced it locally by running the suite from a path with a tilde and a space in it. Then I didn’t patch vite-node — I moved the dynamically-imported modules somewhere that can’t get short-path-mangled and added a test that imports through a deliberately awkward path, so whoever hits this next gets a failing test instead of a mystery.
One good thing came out of a week in the test harness. A SQLite migration test that took 99 seconds now takes about one. Throwaway fixture databases don’t need write-ahead journaling or synchronous commits, and telling SQLite so costs two pragmas. The full suite on the second runner went from 109 seconds to 13.
Not much of a month
3,562 unit tests, 86 adapter tests and 281 route tests passing, security review clean, and one thing deferred: the cost of the schema reconcile step against a real save database rather than a fixture. I measured it on fixtures and then decided I didn’t want to know about real data yet.
Not much to show for four weeks. But a month whose only achievement was finding 26 accounts nobody knew were broken still beats pretending October didn’t happen.
— Bruno