Skip to content

fix(web): raw SQL tiles without a display type load, trace paging stops at the API's offset cap - #2713

Merged
Makisuo merged 3 commits into
mainfrom
triage/web-errors
Nov 16, 2026
Merged

Makisuo merged 3 commits into
mainfrom
triage/web-errors

Conversation

@Makisuo

@Makisuo Makisuo commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

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: RawSqlWidgetDataSource has it as optionalKey(Schema.String), and the share API's raw SQL path accepts its absence. The browser's raw_sql_chart server function required it, so such a tile failed every refresh with WarehouseDecodeError: Missing key at ["displayType"], and dashboard.widget.fetch re-raised it as "Maple could not read the query response." (179 events each, last on 2026-11-16).

getRawSqlChart now takes displayType as 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 passes TracesListQuery's offset <= 2000. new QueryEngineExecuteRequest(...) then threw Schema validation failed as a defect, which crashed the page (foldkit.crash, production, 2026-11-10 and 11-11).

  • MAX_TRACES_LIST_OFFSET in @maple/domain/query-engine is the one cap: the query schema, listTraces input and the page read it.
  • hasNextPage stops once the next offset would pass it.
  • listTraces input is bounded too, so a deeper offset is a typed WarehouseDecodeError instead 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".
  • Typecheck of packages/web-data, packages/domain, apps/web (apart from the unbuilt effect-sdk dist in a fresh worktree); oxlint -c .oxlintrc.effect.json on 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


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Devin Review

…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.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 47b8f029-f2e5-49fb-81d6-cd244b0e2b75
Commits

Reviewing files that changed from the base of the PR and between 4748c8a and bfc7a25.

Files selected for processing: 8

  • apps/web/src/page/traces/list/traces.scene.test.ts
  • apps/web/src/page/traces/list/update.ts
  • apps/web/src/page/traces/list/view-table.ts
  • packages/domain/src/query-engine.ts
  • packages/web-data/src/warehouse/raw-sql-chart.test.ts
  • packages/web-data/src/warehouse/raw-sql-chart.ts
  • packages/web-data/src/warehouse/traces.test.ts
  • packages/web-data/src/warehouse/traces.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@maple-review-bot

This comment has been minimized.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

…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.
@Makisuo

Makisuo commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the Maple review note (F1) in bfc7a25: isCapped counts the offset cap too, so the footer shows "Showing first N traces, narrow the filters to see more" when the offset cap ends paging. The scene test asserts that footer.

@maple-review-bot

maple-review-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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.
no findings · tests covered · risk medium

Relaxes the raw-SQL chart decode so a widget stored without displayType loads, and makes the 2000 offset cap one constant the query schema, listTraces and the trace list all read. Contained to the web client; both fixes are tested.

  • getRawSqlChart accepts a missing or unknown displayType and returns rows as sent
  • MAX_TRACES_LIST_OFFSET in @maple/domain/query-engine is the single offset cap
  • listTraces rejects a deeper offset with a typed WarehouseDecodeError
  • isCapped stops paging at the offset cap and the footer says the list was cut short

Fixed since the last review

  • ✅ F1 · Trace list stops at the offset cap with no hint that more traces exist

bfc7a25 · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit 9ffabcb into main Nov 16, 2026
43 checks passed
@Makisuo
Makisuo deleted the triage/web-errors branch November 16, 2026 16:48
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.

1 participant