Skip to content

Tier 0 bug fixes, plugin de-duplication and splits, and sync test coverage#1564

Merged
datlechin merged 13 commits into
mainfrom
refactor/cleanup-batch
Jun 3, 2026
Merged

Tier 0 bug fixes, plugin de-duplication and splits, and sync test coverage#1564
datlechin merged 13 commits into
mainfrom
refactor/cleanup-batch

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

A batch of correctness fixes and cleanup across the app and plugins, plus new sync test coverage. Every change is build-verified; the new tests compile via build-for-testing and run in CI (the macOS test target cannot run on this dev machine due to the CodeEdit SwiftLint SPM plugin, so they were verified by compiling + reading).

Bug fixes

  • JSON import plugin failed to load: its Info.plist declared TableProPluginKitVersion 17 while the app is at 18, so the version gate rejected it. Bumped to 18.
  • Change-tracking managers defaulted to the MySQL dialect, risking wrong-dialect SQL if generation ran before configuration. DataChangeManager.databaseType is now optional with a guard in generateSQL, and configureForTable requires an explicit dialect. The dead StructureChangeManager.databaseType was removed (DDL comes from SchemaStatementGenerator(pluginDriver:)).
  • SQL export accepted malformed or empty values as numeric and wrote them unquoted into INSERT statements. Replaced with the kit's validated check (PluginNumericLiteral.isValid).
  • CloudflareTunnelManager swallowed the stale-PID encode failure with try?, so leaked cloudflared processes were never cleaned up. Now logged via OSLog.

Plugin cleanup

  • Extracted the shared SQL filter/where/order-by builder (Oracle + MSSQL) into PluginSQLFilter, making the injection-defense escaping a single canonical copy.
  • Extracted isNumericColumnType into PluginExportUtilities (was duplicated in the SQL and JSON export plugins).
  • Split 6 oversized driver files (Redis, DuckDB, Cassandra, ClickHouse, MSSQL, MongoDB) into per-concern files, all now under the 1200-line limit. DynamoDB was left as-is: it is the one plugin still on a legacy explicit project group, so a new file needs manual target wiring the build system did not honor.

Hygiene

  • De-duplicated hex encoding (11 sites) into one Sequence where Element == UInt8 { hexEncoded } extension.
  • Removed the dead DatabaseType.allCases compatibility shim; callers use allKnownTypes.
  • Integrations activity-log export now uses native sheets (AlertHelper) instead of a blocking app-modal alert.
  • Renamed ThemeLayout.swift to ThemeFonts.swift (it only held ThemeFonts, no layout).

Tests

  • Added SyncChangeTrackerTests (dirty/tombstone/suppression/clear, isolated via an injected SyncMetadataStorage).
  • Added ConflictResolverTests (queue/FIFO, keep-server returns nil, keep-local copies local fields onto the server record).

Notes for reviewers

  • TableProPluginKit changes (PluginSQLFilter, PluginNumericLiteral, PluginExportUtilities.isNumericColumnType) are additive public API and ABI-safe, so no PluginKit version bump is needed. The pluginkit-abi check will report an additive diff.
  • An internal refactor audit with the remaining, deliberately-deferred items (coordinator/DI split, design-token layer, the PluginStreamElement ABI bump, brandColor registry design, comments-rule and naming policy) is in docs/development/refactor-audit.mdx, intentionally kept out of the docs navigation.

@mintlify
Copy link
Copy Markdown

mintlify Bot commented Jun 3, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
TablePro 🟢 Ready View Preview Jun 3, 2026, 5:32 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
@datlechin datlechin merged commit 55142a1 into main Jun 3, 2026
5 of 6 checks passed
@datlechin datlechin deleted the refactor/cleanup-batch branch June 3, 2026 10:19
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