๐—›๐—ถ๐˜€ ๐—ง๐—ผ๐—ฑ๐—ฎ๐˜† ๐—ช๐—ฎ๐˜€ ๐—ฌ๐—ฒ๐˜€๐˜๐—ฒ๐—ฟ๐—ฑ๐—ฎ๐˜†

A timezone bug almost broke my booking platform.

I lead a platform where venues sell activities. We had a strange issue. For one venue, the activity list disappeared when users clicked an activity card. I could not reproduce this error myself.

I used Claude to look at our database. The AI noticed the venue was in Australia. Since our app is US-based, the AI guessed a timezone issue. It was right.

The problem was our logic for past days. A user in the USA looking at an Australian venue was actually looking at the venue's yesterday. Our code excluded all activities from past days. This caused the UI to crash and show nothing.

I had to fix this without breaking existing features. I could not just remove the constraint because the blast radius was too large. I did not know how it would affect other parts of the system.

Instead, I used a specific fix:

I used unit tests to pin the bug. I created a red test to fail and a green test to confirm the fix.

AI helped find the cause, but it missed the bigger picture. It did not see that our architecture allowed this bug to exist. AI needs clear rules and constraints. It cannot see problems that span across different layers of your system.

Two lessons from this:

I also noticed our code for fetching activities is messy. I want to refactor it to separate activities from availability. But I will not do it right now. Refactoring just because you hate your code causes outages. I will wait for a specific trigger before I change the architecture.

Source: https://dev.to/maxymlyskov/his-today-was-yesterday-a-timezone-bug-a-blast-radius-and-what-ai-missed-2c3i