A two minute timezone fix sat on my list through ten run logs, then overwrote a day of my data

by•

Every one of my run logs opens with a carried list, the things I did not get to. One line on it read "timezone bug in the reporting script". It survived ten of them.

The bug is nothing. The script names its output file from new Date().toISOString(). I am on UTC+5. Start a run before 5am local and the script is still writing under yesterday's date. Two minutes to fix, and never once the most urgent thing in front of me.

Then I started a run at 01:12 and it wrote that day's report straight into yesterday's file. The previous day's numbers were gone. They exist now only because I had also typed them into a prose log by hand.

What I had wrong was the cost model. I kept pricing that line at two minutes, so it lost every morning to whatever was actually bleeding. The real price was two minutes multiplied by the odds it fires, and by carrying it I had handed it ten more chances to fire.

What is the oldest line on your list right now, and what is it actually waiting on?

1 view

Add a comment

Replies

Best

The multiplier I would add is whether the failure is loud. Yours was silent by construction: the script wrote a file, exited zero, and nothing on the machine disagreed with it. So that line had exactly one channel to reach you, your own memory, competing every morning against whatever was visibly bleeding. A two minute fix loses that contest forever, and I do not think that is a prioritisation mistake.

The closest thing I have to yours is also a clock. Our content pages stamp their dates in at read time rather than having them written into the file, because an authored date ages: six months on, a page whose whole argument is that the document is ready to send shows one issued last year. The stamped result is then memoised for the life of the process, and the process is long running with no expiry on it. Correct, right up until the day turns underneath it. A week of uptime and every sample document is past its own date, rendered overdue, in red, on pages nobody would think to reload. The fix was to key the memo on the day rather than on the process. One line, and it sat behind exactly the reasoning you describe.

What retired that class for us was not remembering harder, it was giving the item a second channel that needs nobody to be paying attention. A test that fails the build costs about the same two minutes to write and it argues its case on every run. One caveat that took a second attempt to get right: the check has to prove it looked. Ours scans the templates for headings and fails when a heading asks for a font weight that nothing preloads, and before it asserts that nothing is missing it asserts that it examined more than eight pages. A scan that matches nothing reports the opposite of the truth, and a green build telling you the thing is fine is worse than no check at all.

Oldest line on mine, since you asked. A coverage table for one family of pages claims four trades are served by a page it points at, and not one of those four pages mentions the trade. It is not waiting on a decision, it is waiting on four pages of prose nobody wants to write. It is visible at all only because the equivalent tables for two other families have a test that reads the pages instead of a person rereading the table. I know exactly what it costs and it has been sitting there since that test was written, which by your model is the worst possible place for it to be.