DEV Community

Andrzej Karaś
Andrzej Karaś

Posted on • Originally published at karas.codes on

How did making coffee help me find a bug in my code?

I know what you're thinking. Did that really happened? My answer is yes, it happened.

Context

It happened a couple of months after I started working in a team that developed browser extension. I got some bug to investigate related with one key feature of its extension.

When I found a code that was the potential culprit of a bug, I just set breakpoints in the browser and started trying to incrementally move through the code to examine it.

But I had no luck. I spent a big chunk of my time trying to trigger it in different ways… but still the corner case I wanted to find was hidden.

Coffee

After a couple of minutes I needed a quick break to make a cup of coffee and to think about other approaches that I could follow to find the culprit. But when I got back to my browser and IDE I spotted that the breakpoint was active! Something had triggered the correct code.

Solution

It turned out that feature I was testing, was using idle browser API. As a name says that API was allowing the user to track a device idle state. Inside a code I found an event handler responsible for doing the rest of the work. Solving a bug was super easy in the end.

That history is still funny after couple years… I still can’t believe that I solved a bug by preparing a coffee :)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay