Repository navigation
fix(history): signal when the history fetch hit its row cap - #630
Merged
Merged
Conversation
The history API capped completed rows and non-completed executions at the row limit with no indication, so pending approvals and summary totals could silently under-report. Add truncated and limit to the response and show a banner above the approval queue and the history table. Refs #248
Contributor
|
Warning Review limit reached
This review includes 11 billable files and costs up to $2.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 23 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (11)
Comment |
Exclude clean completed executions in the store query and from the cap count so mature tenants do not see a permanent banner. Report the fixed executions_limit separately from limit, make the banner text accurate, and clear it when a load fails.
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #248
Problem
GET /api/historyfetches completed rows and non-completed executions at a cap (default 100) and applies the provider/account/date/scope filters afterwards, so rows beyond the cap are dropped silently. Pending approvals and summary totals can under-report with no UI hint.Change
HistoryResponsegainstruncated(bool) andlimit(int); openapi.yaml updated. The response was already an envelope, so this is additive and backward compatible.truncatedis true when the completed fetch returned >= limit rows or the execution fetch returned >= DefaultListLimit rows.history.ts,index.html,types.ts).handler_history_truncation_test.go(at cap, under cap, custom limit, execution cap, scoped user). Mutating either>=to>fails them.Scope interaction
The cap is applied BEFORE scope filtering (the store fetch is global), so a scoped user can lose their own rows behind other tenants' rows.
truncatedis judged on the raw fetch and exposed only as a boolean (no total), so no per-tenant counts leak; the scoped-user test asserts nototalkey. A scoped user may see the banner when the overflow is other tenants' rows. Summary totals are computed from the capped, filtered set, which the banner covers.Decisions (alternatives)
truncated+limitinstead oftotal: a correct total needs COUNT queries with the same SQL filters on two tables, and the executions side is filtered in Go, so a total would need scope-aware counting. Alternative: add COUNT queries plus atotal.len >= limitinstead of fetching limit+1: avoids changing the store call arguments pinned by ~40 existing mock expectations. Cost: a false positive when exactlylimitrows exist (documented in the field comment). Alternative: fetch limit+1 and trim.Verification
go test -race -short ./... , go vet ./... , go vet -tags integration ./internal/..., openapi tests pass; errcheck -blank, shadow, misspell clean on changed lines. Frontend jest test added but NOT run locally (no node_modules offline); CI will run it.
Why partial: paging and the executions-side SQL filtering remain open, so this is Refs, not Closes.
Review follow-up
truncated.limit(completed rows, request-controlled) andexecutions_limit(fixed 100) separately; banner names both.