Sometimes the bug is with the data not the code

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the dumb-mistakes-and-gotchas category.

Last Updated: 2024-04-25

For the Project M, the autocomplete on the production server was not sorting the house_numbers in the order supposedly defined in the latest JavaScript changes.

I tried changing the code again and again (e.g. removing caching), but I could not get them to sort as I expected.

The issue was that I had not seeded the production database with the right data.

Lessons

  1. Sometimes it isn't a bug with the code — it's one with the data. I should consider this possibility much sooner in the debugging process.
  2. Don't try things again and again and hope they will work because of some magic caching.