Repository navigation
fix(web): raw SQL tiles without a display type load, trace paging stops at the API's offset cap - #2713
Conversation
…ps at the API's offset cap A raw SQL widget may be saved without displayType (the stored source and the share API both allow it), but the browser's raw_sql_chart fetch required one, so those tiles failed with "Missing key at displayType". It now returns the rows as sent, like the share API. The traces list asks for (pages + 1) * 100 rows consumed. With noise traces hidden, fewer than 2000 rows can show while that offset passes the query's 2000 cap, and the request constructor threw, crashing the page. The list now stops at MAX_TRACES_LIST_OFFSET, and listTraces rejects a deeper offset as a typed decode error.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
…et cap ends paging Review note: with noise traces hidden, paging can stop at the offset cap while few rows show, and the footer read like a complete list. isCapped now counts both caps, and hasNextPage reads it.
|
Addressed the Maple review note (F1) in bfc7a25: |
Maple review🟢 Confidence 10/10 · safe to merge. Both fixes are pinned by new tests, and the production error comes from the exact span the diff relaxes. Relaxes the raw-SQL chart decode so a widget stored without
Fixed since the last review
|
Two dashboard bugs from the production error triage.
Raw SQL tiles saved without a display type
A raw SQL widget can be stored without
displayType:RawSqlWidgetDataSourcehas it asoptionalKey(Schema.String), and the share API's raw SQL path accepts its absence. The browser'sraw_sql_chartserver function required it, so such a tile failed every refresh withWarehouseDecodeError: Missing key at ["displayType"], anddashboard.widget.fetchre-raised it as "Maple could not read the query response." (179 events each, last on 2026-11-16).getRawSqlChartnow takesdisplayTypeas optional and open. A missing or unknown value returns the rows as the API sent them, the same thing the share API does for the same widget. Known types still reshape as before.Trace list "load more" crash
The traces list pages by warehouse rows consumed: the next offset is
(pages + 1) * 100. Noise traces are hidden after the read, so the shown rows can stay well under the 2000-row retention cap while the offset passesTracesListQuery'soffset <= 2000.new QueryEngineExecuteRequest(...)then threwSchema validation failedas a defect, which crashed the page (foldkit.crash, production, 2026-11-10 and 11-11).MAX_TRACES_LIST_OFFSETin@maple/domain/query-engineis the one cap: the query schema,listTracesinput and the page read it.hasNextPagestops once the next offset would pass it.listTracesinput is bounded too, so a deeper offset is a typedWarehouseDecodeErrorinstead of a throw from the request constructor.Verification
packages/web-data/src/warehouse/raw-sql-chart.test.ts(new): a widget with no display type, or an unknown one, gets its rows; a line chart still reshapes. With the old code the first two fail with the production message (Missing key).traces.scene.test.ts: "paging stops at the API's deepest offset even when hidden noise keeps the shown rows few". Without the guard it asks for offset 2500.traces.test.ts: "refuses an offset past the list's cap as invalid input, without reading".packages/web-data,packages/domain,apps/web(apart from the unbuilt effect-sdk dist in a fresh worktree);oxlint -c .oxlintrc.effect.jsonon the touched files.No before/after screenshot: a local repro needs a raw SQL widget stored without a display type, or an org with more than 2000 trace rows in the window. Neither is in the local seed data.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.