A script said 'patched' twice. Neither time did anything change.

by

Was updating some backend code straightforward find-and-replace, target text, swap it in, print success. Ran it. Got "PATCHED." Checked the file to confirm the change landed.

Nothing had changed.

Ran it again with slightly different phrasing. "PATCHED" again. Still nothing changed.

Turned out the target text in the file used a real em-dash (—), and my search pattern used a plain double-hyphen (--). Visually close enough that I didn't catch it reading the code. The script's "success" message was printing regardless of whether the replace actually matched anything it was reporting that the script ran, not that the edit happened.

Nothing broke because I'd built in a habit of grepping the file afterward to confirm, rather than trusting the print statement. That one habit is the only reason two silent no-ops didn't turn into "I thought I fixed this three days ago" later.

The lesson that actually stuck: a tool's own success message tells you the tool ran without erroring. It doesn't tell you it did the thing you wanted. Those are different claims, and the gap between them is exactly where quiet bugs live.

Anyone else got a "it said it worked" story that turned out to be lying to you in a technically-true way?

12 views

Add a comment

Replies

Be the first to comment