fix: preserve query result text#588
Conversation
Review — PR #588 "fix: preserve query result text" (Level 3)Quality gate: typecheck ✅ · lint ✅ · build ✅ · unit tests ✅ (1510 passed, incl. the new Issues
False-positives
SummaryVerdict: Approve, pending one confirmation. The change is correct, well-scoped, and well-tested. Removing The one thing to resolve: Finding #1 — the console now depends on the paired server change (questdb#7406) for EXPLAIN rendering, and the demo/dev server this branch proxies to hasn't shipped it, so EXPLAIN plans visibly regress there. This is a documented, intentional tradeoff, but merge should be coordinated with the server release (and reviewers should be aware the local dev experience against demo will show entity-encoded plans until then). Regressions/tradeoffs: old-server EXPLAIN rendering (Finding #1); tabs now render wider (Finding #2, likely intended). Verification tally: 3 findings verified (1 Moderate, 2 Minor); 6 draft findings dropped as false positives (verified against source + empirical browser/curl tests). In-diff vs out-of-diff: 3 in-diff, 0 out-of-diff — Agent 12 walked all six consumer callsites (ResultGridAdapter, ResultActionsBar, ResultGridPanel/InlineResultTable, useGridKeyboardNav, legacy grid.js, quick-vis) and found every one SAFE; the changed symbols are pure display/copy utilities whose output only reaches the DOM as text or the clipboard, so a zero out-of-diff count is correct here, not an underrun. |
Summary
Problem
QuestDB's HTTP EXPLAIN response historically contained HTML entities as a Web Console presentation workaround. The console compensated by applying
unescapeHtmlto every result value, not only to structural query-plan indentation.That made ordinary query results lossy: legitimate values such as
,<,>,&,", and'could be changed even though they were user data. Trying to detect EXPLAIN queries client-side would still be fragile and would not resolve collisions between plan structure and SQL literals embedded in a plan.Closes #587.
Solution
The paired QuestDB server change returns EXPLAIN plans as plain text. With that contract, the Web Console can treat every response value as data:
unescapeHtmlcalls and the unused helperwhite-space: preNo client-side EXPLAIN detection or SQL tokenization is needed.
Validation
Related