1
2 Comments

I spent 3 weeks debugging one bug that turned out to be a single misnamed column

My app kept saying "no results found" while the backend logs showed the AI working perfectly. Data was being saved. It just wasn't being displayed. Three weeks of RLS policies, edge function rewrites, file type theories, and payload debugging and the actual cause was that the frontend queried lab_report_id while the backend wrote report_id. One word. I learned more from that than from anything that worked first try. What's the dumbest bug that's eaten weeks of your life?

on July 18, 2026
  1. 1

    The useful clue was “data saved, UI empty.” Once a write succeeds and the read returns zero, I'd stop touching the AI path and diff the boundary contract: actual row keys against query keys. One integration test that inserts report_id and reads it through the frontend query would have collapsed the three-week search immediately.

    1. 1

      That's a much better diagnostic instinct than what I had. "Write succeeds, read returns zero" should have immediately pointed me at the contract between the two, and instead I went and rewrote the edge function twice and developed an elaborate theory about HEIC file conversion. Classic case of debugging the interesting part instead of the boring part.
      The integration test point stings in a useful way, one test asserting insert then read through the actual frontend query would've caught it in an afternoon. I have zero tests right now, which felt fine when I was moving fast and feels a lot less fine after losing three weeks. Adding that boundary test today.