Repository navigation
QueryNodeViewer: getSchema fails with SCHEMA_NOT_FOUND on fresh database - #993
Conversation
…ase (#989) When getSchema returns SCHEMA_NOT_FOUND (fresh database without core schema initialization), show an empty state instead of an error with retry button. Downgrades the log from error to debug for this expected case. Also fixes pre-existing Svelte lint error in generic-schema-form.svelte where $state(autoOpen) only captured the initial prop value. Co-Authored-By: Claude <[email protected]>
Code Review: PR #993 — QueryNodeViewer: getSchema fails with SCHEMA_NOT_FOUND on fresh databaseReview Type: Initial Review Requirements Check (Issue #989)
The fix addresses the root cause identified in the issue: on a fresh database without core schema initialization, Code Review FindingsSuggested Improvements1. [Improvement] function isSchemaNotFound(message: string): boolean {
return message.includes('not found') || message.includes('SCHEMA_NOT_FOUND');
}The Recommendation: Tighten the match to only match the specific Rust backend format function isSchemaNotFound(message: string): boolean {
return message.includes('SCHEMA_NOT_FOUND') || /Schema '.*' not found/.test(message);
}The Severity: This is a real concern but not a blocker for a pre-release codebase. The fix is a one-line regex change. 2. [Improvement] The let isOpen = $state(false);
$effect(() => {
if (autoOpen) isOpen = true;
});This correctly fixes the Svelte lint issue where Severity: Not an issue -- just documenting the intent for future readers. The existing comment on line 39 adequately explains the rationale. NitpicksNit: Nit: The commit message is well-structured -- it explains both the schema-not-found fix and the generic-schema-form fix with clear rationale. The "Also fixes" prefix correctly signals the secondary change is a pre-existing issue addressed opportunistically. Good practice for atomic-but-related fixes. Overall AssessmentThis is a clean, minimal fix that correctly addresses the issue. The change is well-scoped: two files, ~20 lines of net new code, single cohesive purpose. The approach of treating schema-not-found as an expected condition (empty state) rather than an error state is the right call for a fresh database scenario. The The one substantive concern is the overly broad string matching in No tests exist for either component. This is a pre-existing gap, not introduced by this PR. Given the fix is purely defensive error handling in a UI component, the risk is low. Final Recommendation: APPROVE (with suggestion)The PR is a net positive improvement to code health. The schema-not-found handling is correct, the log level change is appropriate, and the generic-schema-form fix addresses a real reactivity bug. The string matching suggestion is worth addressing but does not block merge. |
malibio
left a comment
There was a problem hiding this comment.
APPROVE (posted as comment because GitHub prevents self-approval). One suggestion: tighten the isSchemaNotFound string match from message.includes('not found') to a regex like /Schema '.*' not found/ to avoid masking unrelated errors. The SCHEMA_NOT_FOUND code check alone covers the Tauri path. See PR comment for full review.
Use regex /Schema '.*' not found/ instead of broad includes('not found')
to avoid masking unrelated errors (e.g., "Connection endpoint not found").
Co-Authored-By: Claude <[email protected]>
Review Feedback Addressed✅ Addressed (1/1)🟢 Tighten ⏭️ Skipped: NoneAll tests pass (119 files, 3748 tests). |
…ase (#993) * fix: QueryNodeViewer handles missing schema gracefully on fresh database (#989) When getSchema returns SCHEMA_NOT_FOUND (fresh database without core schema initialization), show an empty state instead of an error with retry button. Downgrades the log from error to debug for this expected case. Also fixes pre-existing Svelte lint error in generic-schema-form.svelte where $state(autoOpen) only captured the initial prop value. Co-Authored-By: Claude <[email protected]> * Address review: tighten isSchemaNotFound matching Use regex /Schema '.*' not found/ instead of broad includes('not found') to avoid masking unrelated errors (e.g., "Connection endpoint not found"). Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
Closes #989