Skip to content

fix(schemas): surface get_schemas failure with error + retry#242

Merged
debba merged 3 commits into
TabularisDB:mainfrom
verbaux:fix/e3-schema-load-silent-failure
May 26, 2026
Merged

fix(schemas): surface get_schemas failure with error + retry#242
debba merged 3 commits into
TabularisDB:mainfrom
verbaux:fix/e3-schema-load-silent-failure

Conversation

@verbaux
Copy link
Copy Markdown
Contributor

@verbaux verbaux commented May 21, 2026

Problem

When get_schemas rejects, the structure tree silently renders an empty flat layout — TABLES (0) / VIEWS (0) / ROUTINES (0), no SCHEMAS header, no error. The connection looks open (the test connection succeeds on a separate code path), so it appears connected but shows nothing, with no indication anything failed.

image

Real-world example that exposed it: a Postgres database reached over an SSH tunnel failed the TLS handshake (InvalidCertificate(UnknownIssuer)). The schema fetch was rejected, but the UI showed only an empty tree (I still see this behavior in my app v0.10.3, but the fix for this issue has been implemented).

This PR addresses the missing UX safety net, which covers the whole class of get_schemas failures — TLS, permissions, dropped tunnel, network.

8oMogZ4eAAa

When get_schemas rejected, the catch only cleared loading flags and set
isConnected: true, leaving schemas empty with no error — the structure
tree rendered a silent empty 'no tables' state. The sidebar now shows a
'Failed to load schemas' message + Retry when a schema-capable
connection has an error and no schemas. Retry re-runs connect().

- DatabaseProvider: set error/schemas/needsSchemaSelection in the catch
- ExplorerSidebar: error branch with AlertCircle + Retry
- i18n: add sidebar.schemaLoadError + sidebar.retry (en, ru)
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 21, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (10 files)
  • src/components/layout/ExplorerSidebar.tsx - Collapsible error details with copy button; line-clamp-2 brief truncation for Postgres \n\n split; state and timeout patterns follow existing codebase conventions
  • src/contexts/DatabaseProvider.tsx - Unchanged since previous review; catch block still correctly stores error, resets schemas: [], and sets needsSchemaSelection: false
  • src/i18n/locales/en.json - Added sidebar.errorDetails and sidebar.copyError
  • src/i18n/locales/ru.json - Added sidebar.errorDetails and sidebar.copyError
  • src/i18n/locales/de.json - Added sidebar.schemaLoadError, sidebar.errorDetails, sidebar.copyError, sidebar.retry
  • src/i18n/locales/es.json - Added sidebar.schemaLoadError, sidebar.errorDetails, sidebar.copyError, sidebar.retry
  • src/i18n/locales/fr.json - Added sidebar.schemaLoadError, sidebar.errorDetails, sidebar.copyError, sidebar.retry
  • src/i18n/locales/it.json - Added sidebar.schemaLoadError, sidebar.errorDetails, sidebar.copyError, sidebar.retry
  • src/i18n/locales/ja.json - Added sidebar.schemaLoadError, sidebar.errorDetails, sidebar.copyError, sidebar.retry
  • src/i18n/locales/zh.json - Added sidebar.schemaLoadError, sidebar.errorDetails, sidebar.copyError, sidebar.retry

Reviewed by kimi-k2.6 · 3,437,777 tokens

debba added 2 commits May 25, 2026 21:20
The empty-tree fallback now shows a two-line brief above a collapsible
Details section that holds the full raw error and a copy button. For
Postgres the brief is taken from the part before "\n\n" produced by
map_pg_err / format_pg_error (Display, with the Debug dump tucked into
the expanded box); other drivers fall through unchanged and are
visually truncated by line-clamp.

Adds the new sidebar keys (errorDetails, copyError) plus the previously
missing schemaLoadError / retry to de, es, fr, it, ja, zh.
@debba
Copy link
Copy Markdown
Collaborator

debba commented May 25, 2026

Hey @verbaux — quick UX adjustment I made on top of your branch before merging.

The raw error from a failed get_schemas (TLS, perms, dropped tunnel) lands in the sidebar as "{Display}\n\n{Debug}" produced by map_pg_err / format_pg_error in drivers/postgres/client.rs, so showing it as-is made the column either very tall or visually noisy. I tucked it behind a Details chevron:

  • Preview under the title: only the part before \n\n (Display), line-clamp-2. Non-Postgres drivers don't use that separator, so the split is a no-op and the clamp handles overflow.
  • Expanded: full raw text in a scrollable <pre> with a copy button (briefly toggles to a ✓ on click).

Also filled the new sidebar keys (schemaLoadError, errorDetails, copyError, retry) across the remaining 6 locales (de, es, fr, it, ja, zh) so they don't fall back to English.

I'm ready to merge unless you'd prefer a different layout — let me know.

@verbaux
Copy link
Copy Markdown
Contributor Author

verbaux commented May 26, 2026

Hello @debba!
Thanks for your addition — I checked how it looks, and it really much better.

@debba debba merged commit 8fc0f3a into TabularisDB:main May 26, 2026
2 checks passed
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.

2 participants