Back to feed
Dev.to
Dev.to
8/2/2026
9,104 rows in, 5,000 out: the silent cap that made my dashboard lie

9,104 rows in, 5,000 out: the silent cap that made my dashboard lie

Short summary

A silent 5,000-row cap in a generic query endpoint truncated 9,104 rows of search-rank data, causing a dashboard to show 'no change' instead of missing data. The bug stayed hidden because absence and zero rendered identically, and the cap returned HTTP 200 with no warning. The fix: fold windowing logic into SQL using Postgres DISTINCT ON so response size is bounded by keyword count, not row count, and always surface truncation explicitly in the response body.

  • Silent row caps that return HTTP 200 cause dashboards to lie by showing missing data as zero or no-change
  • Fix: use Postgres DISTINCT ON to compute latest-per-key in SQL, bounding response by entity count not row count
  • Missing and zero are different values and must render differently; always include truncated:true in capped responses

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more