Skip to content

fix(api): prevent false positive truncation warning when query result count equals limit - #12

Open
trexfr-ops wants to merge 1 commit into
TrudieMasenheimer3:mainfrom
trexfr-ops:fix/query-limit-truncation-boundary
Open

fix(api): prevent false positive truncation warning when query result count equals limit#12
trexfr-ops wants to merge 1 commit into
TrudieMasenheimer3:mainfrom
trexfr-ops:fix/query-limit-truncation-boundary

Conversation

@trexfr-ops

Copy link
Copy Markdown

Description

Closes #1

This PR resolves the false positive truncation warning in the Prometheus query execution path where queries returning exactly N items against a limit of N incorrectly appended a truncation warning.

Key Changes

  1. Updated query evaluation in web/api/v1/api.go to request limit + 1 elements when evaluating limited queries.
  2. Truncation and the query processing limit reached warning are now only triggered when len(fetched) > limit. When len(fetched) <= limit, all results are returned with zero warnings.
  3. Added unit tests in web/api/v1/api_test.go covering under-limit, exact-limit boundary, over-limit truncation, and range queries (all 5 tests passing).

Bounty Claim & Payout Addresses

/claim #1

  • LTC: LPnftYop8yhRNQZstysT3vuJf3XkpQWKTC
  • EVM (Base/ETH): 0x32BB3df5B74a594956a0f33Bc353511Fa759FCa4
  • Solana (SOL): 8Xo39uq9LoaM2rQEkgaaSfuThqHZTd18yGdJSXffkLwM
  • BTC: bc1qpyu6866qcgt26sqw4dn2mlmp8d0yc657fuedkv
  • DOGE: DDMU6D9TCE3BhqqYyy7MUZQD7JhfL39FpE

@opirebot

opirebot Bot commented Aug 19, 2026

Copy link
Copy Markdown

😅 Unfortunately there are no rewards left to claim in this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🎯 Fix false positive truncation warning in /api/v1/query when result count equals limit

1 participant