14 Seconds to Find the Bug, 3 Hours to Fix It Wrong
by•
A production error pointed to a null value. I asked the agent to fix it. It added a guard clause. Tests passed. Deployed.
Error came back because the guard was in the wrong layer.
The bug was in the data mapper. The agent fixed the controller. I spent three hours on a fix that looked correct because the test mocked the mapper.
What's a bug you fixed in the wrong place?
15 views
Replies
Mine is from this week. My backend pauses a feature by itself when a partner API refuses our token. It paused once with the next hourly check passing fine, so I read it as the partner being flaky and added two retries before a refusal counts. It paused again four days later. The real cause was on my side: 44 test fixtures carried an id the partner never issued, the hourly sync asked about each of them three times, and after dozens of refusals in a row the partner refused the valid token for a while too. The retry was a guard in the wrong layer, same as yours. The actual fix was to stop asking about ids we never got from them.