Skip to content

fix: polish error messages and noisy outputs#147

Merged
alvarogar4 merged 1 commit into
mainfrom
alvaro/num-7276-error-message-polish
Jun 11, 2026
Merged

fix: polish error messages and noisy outputs#147
alvarogar4 merged 1 commit into
mainfrom
alvaro/num-7276-error-message-polish

Conversation

@alvarogar4

Copy link
Copy Markdown
Member

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).

  • internal doc cleanup #19 — a table with orderBy but no primaryKey no longer crashes with a raw TypeError. normalizeKeyColumns is guarded against undefined and the primary key defaults to the order-by columns, matching ClickHouse.
  • marc/num 6437 create documentation website on chkitobsessiondbcom #20 — built-in (core) command errors surface their own clean message instead of Plugin "core" failed in command:<x>: …. Internal plugins are marked and their command errors rethrown raw.
  • 🔧 Add .tmp to .gitignore #24chkit query syntax errors no longer leak the injected FORMAT JSON/JSONEachRow clause the user never typed, and the ~40-item "Expected one of" token dump is capped.
  • marc/num 6386 add a table filter to all commands #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 instead of leaking the raw client string.
  • #38a — the post-apply message names the resolved journal table (respecting CHKIT_JOURNAL_TABLE) instead of a hardcoded _chkit_migrations.
  • #38b — the ObsessionDB "authenticated but no service selected" reminder is suppressed when a direct clickhouse target is configured (it was layered in from a global chkit obsessiondb login, not chosen for the project). onInit now receives config.

Test plan

🤖 Generated with Claude Code

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>
@alvarogar4 alvarogar4 merged commit d9d5038 into main Jun 11, 2026
6 checks passed
@alvarogar4 alvarogar4 deleted the alvaro/num-7276-error-message-polish branch June 11, 2026 08:47
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