Repository navigation
Closed
Labels
Description
Status: filed
Drives: docs/audits/compare.md
Findings
Critical (P0/P1)
- F1 [P0] [security] SyncPreview handleExecute runs each statement independently via executeQuery — no transaction, no escaping of targetDatabase, no production safety, no read-only check — [P0][security] SyncPreview handleExecute runs each statement independently — no transaction, no escaping, no production safety, no read-only #369
- F2 [P0] [bug] SchemaSnapshot has no foreignKeys field — schema diff silently misses all FK changes; sync generator emits no FK DDL — [P0][bug] SchemaSnapshot has no foreignKeys field — schema diff silently misses all FK changes; sync generator emits no FK DDL #370
- F3 [P0] [bug] compareSchemas for views/routines/triggers compares DDL by normalizeDdl (whitespace + lowercase) — any change inside a string literal is reported identical — [P0][bug] compareSchemas normalizes DDL via whitespace+lowercase — string-literal changes are reported identical #371
- F4 [P1] [security] SyncPreview
USE ${targetDatabase}uses raw string concat — targetDatabase not escaped via escapeId — [P1][security] SyncPreview USE ${targetDatabase} uses raw string concat — targetDatabase not escaped via escapeId #372 - F5 [P1] [perf] fetchSnapshot issues N+1 IPC calls per table — slow on large schemas — [P1][perf] fetchSnapshot issues N+1 IPC calls per table — slow on large schemas #373
- F6 [P1] [bug] compareColumns ignores column order — reorder is reported identical — [P1][bug] compareColumns ignores column order — reorder is reported identical #374
- F7 [P1] [ux] SchemaCompare different routines/triggers show only a name badge — no DDL delta — [P1][ux] SchemaCompare different routines/triggers show only a name badge — no DDL delta #375
Backlog (P2/P3)
- F8 [P2] [perf] compareSchemas runs synchronously on the main thread — large schemas freeze the UI
- F9 [P2] [security] SyncPreview Copy Selected omits the USE line and handleExecute strips comments naively
- F10 [P2] [ux] SchemaCompare allows same source and target database — confusing zero-change diff outcome
- F11 [P2] [bug] sync-sql-generator routine ALTER concatenates DROP + CREATE as one sql field — destructive nature hidden
- F12 [P3] [test] SchemaCompare.test.tsx covers MariaDB-warning but not basic object diff UI behaviour
- F13 [P3] [convention] classifyRoutinesError regex is over-broad — matches anywhere in error string
- F14 [P3] [arch] No unit tests for lib/schema-diff.ts or lib/sync-sql-generator.ts
Good (👍)
- MariaDB-upgrade graceful degradation with classifyRoutinesError + dedicated banner
- Include routines toggle checked by default (opt-out)
- Promise.all parallelism for snapshot fetch
- Destructive statements pre-deselected in SyncPreview
- Confirmation dialog before Execute
- Drop-then-add semantics for index changes
- escapeId helper exists and is used in sync-sql-generator.ts
- IPC chain is clean (api.* only)
- Test coverage of failure paths (MariaDB warning, dismiss, error fallback)
- objectType on SyncStatement distinguishes TABLE/VIEW/PROCEDURE/FUNCTION/TRIGGER
Doc drift
- ARCHITECTURE §5.3 get_foreign_keys signature is unimplemented — F2.
- DESIGN_REQUIREMENTS FR-8.3.2 (Data compare) is the wrong feature; schema compare has no dedicated FR.
- TESTING_STRATEGY has no compare_tests.rs table.
Activity
EVWorth commentedon Sep 9, 2026
Closed by removing the feature.
Schema compare could not back the claim it made — foreign keys were absent from the snapshot entirely, DDL was compared after lowercasing and collapsing whitespace, and column order was ignored — while the sync half could leave a target half-migrated. A compare tool that is quietly wrong is worse than none, because people act on its answer.
Fixing that properly is a real piece of work, most of it a genuine DDL comparison rather than string normalisation, and the feature is not part of how this project is used. Removed rather than carried: the history has it if someone wants it back.
Removed in the PR closing this issue: SchemaCompare, SyncPreview, schema-diff, sync-sql-generator, their tests, the
compareeditor tab type, and the menu, title-bar and toolbar entry points.