Succesful Deployment

Typos are the bane of delevopers' existence. For most of our typos, the result is a syntax error. It's quick and easy to find and fix. But any time we're working with strings (or in languages where variables are declared at use) there can be many more subtle bugs.

So when Abigail's company sent an intern off to fix a few typos, they thought this was a lovely little low-hanging fruit bug to fix.

There were three typos which needed to be fixed.

return res.json({
	status: "failurez",
	...
});
...
return res.json({
	status: "succesz",
	...
});
...
Promise.all(data).then(()=> {
	resolve("succes");
	...
});

The intern made the changes and submitted a merge request. The request was reviewed, and the codebase was searched to make sure nothing was depending on those typos. Nothing was, so it was merged and eventually deployed. And that's the moment all hell broke loose.

Because while they checked their internal code to ensure that nothing depended on these misspellings, they had customers who consumed this API. While the documentation suggested that the customers should rely on HTTP status codes to determine success or failure, several customers didn't follow that advice and manually checked the status field, and thus depended on seeing "succes" or "succesz" in the output.

The shocking twist is that these customers were willing to update their code. Not to check the HTTP status codes, which would have required a rewrite of some logic, but to correct the spelling of "success".

[Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.

This post originally appeared on The Daily WTF.

Leave a Reply

Your email address will not be published. Required fields are marked *