Two bugs, one cause: when an API can't tell you it failed
Two unrelated bugs, in two different codebases, turned out to be the same mistake: trusting an API's status code and shape instead of checking the field that actually tells you what happened.
31notes from production work
I build software end to end. I'm Scott Mallinson, a senior software engineer at Cognizant in Barcelona, Spain. I write about API design, type systems, guardrails for AI features, and the maintenance that keeps a codebase navigable.
Two unrelated bugs, in two different codebases, turned out to be the same mistake: trusting an API's status code and shape instead of checking the field that actually tells you what happened.
Where the defect appears and where it's best fixed are different questions. I have a habit of answering the first and acting as though I have answered the second.
I capped my assistant's tool catalogue at three tools per integration and six hundred tokens. Every new capability since has had to become a parameter on an existing tool.
I wrote a 1.5 second latency target into a spec and reasoned from it for weeks. Measured, the real figure was 60 to 110 seconds.
An auth token held in memory and a SQLite file on disk both worked locally and disappeared in production, because my laptop provides durability the serverless platform doesn't.
Two background jobs stopped early and recorded themselves as complete, and once recorded, nothing in the system could reopen them.