A customer typed a long size description into a shirt-size field, hit submit, and lost the entire registration, not just the row with the bad value. The field was free text, the database column had a length limit, and the overflow threw an error that took the whole import down with it.

The first fix looked complete

We built canonical size codes so the field would be a dropdown instead of free text, and added a length guard to the save path so anything too long would fail cleanly instead of crashing. It compiled, it deployed, and we moved on.

It did nothing. The guard was correct code in the wrong place: an older dialog handler that used to own the save action, before the live “edit this field” flow was rebuilt to call a different function entirely. The path a real edit actually runs through had no length check at all, the same as before the fix shipped.

Testing the wrong thing

We had already tested the guard against the live production endpoint, watched it come back clean instead of crashing, and called that definitive proof the fix was live. We were most of the way through closing the ticket when a pointed question stopped us: hadn’t these popups already been migrated, and were we sure the page we had just patched was still in use?

So we traced the actual click path instead of the file we remembered editing. The guard was sitting in dead code. Nothing in the current UI called it anymore. Whatever used to route through it had been replaced, and nobody had gone back to delete the old handler or update the comment claiming it was still load-bearing.

Moving the guard to the real save path took a few minutes once we knew where to look. Verifying it took longer. We ran the same over-length value through the actual edit dialog and confirmed it came back as a clean validation error instead of a crash, then ran a normal, valid value through the same path to confirm nothing else broke. Both hotfixes shipped to production.

What the guard proved

Saying we fixed the validation and saying we fixed the validation in the code that runs when someone clicks save are different claims, and only the second one helps the person hitting the bug. A length guard in a function nothing calls is indistinguishable from no guard at all, right up until someone reads the diff and assumes the problem is solved.

Our earlier test had passed, and that was the trap. It showed the endpoint behaved, and it never showed that the endpoint was reached from the button a customer presses. Before calling a validation fix done, trace the live entry point by hand: the one thing the current UI invokes when a real person clicks the real button. If nobody can point to that call chain, the fix is unverified, because all we have shown is that some code somewhere now has a guard in it.