DEV Community

Wei Bin
Wei Bin

Posted on

The Worst Bug Is the One That Returns 200

A reader found the worst bug in one of my tools last week, and it was not a crash.

I run a small web-to-Markdown converter. He fed it a documentation page built with tabbed panels — the kind Docusaurus generates, sixteen tabs of install instructions. The API returned 200. Clean Markdown. Reasonable length. Four tabs' worth of content.

Twelve tabs were simply missing. No error, no warning, nothing in the output hinting that anything was absent. If he had piped it straight into a RAG pipeline, which is exactly what the tool is for, the missing twelve tabs would have become wrong answers his users could never trace back to us.

Errors are loud. Omissions are silent. That is why this class of bug scares me more than any 500.

Here is what I changed, and what I now think every extraction or conversion tool should do:

1. Count the sub-units, not just the output.
If a page contains structured sub-content — tabs, accordions, paginated sections, product variants — enumerate them before extraction and count what made it into the result. "Found 16, captured 4" is a fact you can act on. A character count is not.

2. Return completeness metadata with the result.
The response now carries what was found, what was captured, and whether the result may be incomplete. A caller should never have to guess whether they got the whole page. And if you have no reliable signal, say so — do not invent a reassuring flag.

3. Keep a dirty-sample regression set.
My test set now permanently includes a real tabbed documentation page, plus a long plain article as a control. Every fix gets re-run against both: fix the tabs without breaking the article. Test fixtures you invent yourself are too polite. Real pages are rude in ways you cannot predict.

4. Admit the boundary of what you cannot see.
Some content only exists after the browser renders it — it is not in the static source at all. That is a different problem from dropping content that is there, and the honest move is to label it, not to pretend your static extractor handles it.

The uncomfortable lesson: my tests all passed while the tool was returning a quarter of the page. They validated what was present. Nobody had written a test that counted what was missing.

If you build anything that transforms content — scrapers, converters, importers, sync jobs — go write that test today. What does your tool silently drop?

Top comments (0)