fix: polish error messages and noisy outputs#147
Merged
Conversation
Six error-UX fixes from the prod-ready audit: - #19 — a table with `orderBy` but no `primaryKey` no longer crashes with a raw TypeError; PK defaults to orderBy (ClickHouse semantics). Guard normalizeKeyColumns against undefined. - #20 — built-in (core) command errors surface their clean message instead of the `Plugin "core" failed in command:<x>` wrapper. Mark internal plugins and rethrow their command errors raw. - #24 — `chkit query` syntax errors no longer leak the injected FORMAT JSON clause, and the "Expected one of" token dump is capped. - #11 — connection errors whose reason is only in the message (no `.code`), e.g. a typo'd host, are recognized via message substrings and cleaned. - #38a — the post-apply message names the resolved journal table (CHKIT_JOURNAL_TABLE), not a hardcoded _chkit_migrations. - #38b — the ObsessionDB "no service selected" reminder is suppressed when a direct clickhouse target is configured (onInit now receives config). All fixes covered by unit + live e2e tests, verified against the .env.test cluster. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Six error-UX fixes from the prod-ready audit (PR K). Each has a unit or live e2e test, and every test was mutation-verified (revert the fix → the test fails).
orderBybut noprimaryKeyno longer crashes with a rawTypeError.normalizeKeyColumnsis guarded againstundefinedand the primary key defaults to the order-by columns, matching ClickHouse.core) command errors surface their own clean message instead ofPlugin "core" failed in command:<x>: …. Internal plugins are marked and their command errors rethrown raw.chkit querysyntax errors no longer leak the injectedFORMAT JSON/JSONEachRowclause the user never typed, and the ~40-item "Expected one of" token dump is capped..code) — e.g. a typo'd host — are recognized via message substrings and cleaned instead of leaking the raw client string.CHKIT_JOURNAL_TABLE) instead of a hardcoded_chkit_migrations.clickhousetarget is configured (it was layered in from a globalchkit obsessiondb login, not chosen for the project).onInitnow receivesconfig.Test plan
turbo run build typecheck lintgreen.cleanQueryError(🔧 Add .tmp to .gitignore #24),formatConnectionErrormessage fallback (marc/num 6386 add a table filter to all commands #11), PK-default canonicalization (internal doc cleanup #19), obsessiondbonInitsuppression both directions (#38b)..env.testcluster: aquerysyntax error is unwrapped + FORMAT-stripped (marc/num 6437 create documentation website on chkitobsessiondbcom #20+🔧 Add .tmp to .gitignore #24); a non-JSON apply withCHKIT_JOURNAL_TABLEnames the override (#38a).patchchangeset for chkit / @chkit/core / @chkit/clickhouse / @chkit/plugin-obsessiondb.🤖 Generated with Claude Code