The Six-Year-Old Workaround Comment Still in Your Code
Resumo
Pixel shares a lesson from a telephony integration where a vendor bug was fixed within days, but its workaround comment remained for six years. The announcement offers four practices for managing workarounds: link vendor tickets in code, document evidence, define removal conditions, and use named settings instead of magic numbers.
DEV Community
The comment that has been lying for six years
Working around a vendor bug is quick. Getting the workaround out of your code is the hard part. In 2020, I integrated automated text-to-speech call campaigns with a telephony provider. We replaced polling for responses with events received on a public route. So far, so good. The provider's API had a bug, already reported to them, when a call involved more than one contact. The workaround: limit it to one call at a time and change the priority to respect the dialing schedule. Two days later, the vendor fixed the bug and we went back to two calls. The value changed. The comment next to it kept saying "at most 1 call at a time". It still says that today, six years later. It's not a disaster. But it's a portrait of how workarounds usually live: the reason stays in the commit message, the code moves on, and the comment becomes a lie. Today, for any vendor workaround, I ask for four things: A link to the ticket opened with the vendor, in the code and not only in the commit. Documentation that confirms the bug is real: the vendor's reply or evidence that reproduces it. The removal condition: "when the ticket is resolved" or "when API version X ships". The value in a named setting, not a magic number with a comment beside it. Comments describe intent. Only tests and configuration follow the change. What's the oldest workaround still alive in your code?

Powered by Readybot.io