Skip to content

fix: import system error handling, decompression, and correctness#783

Open
datlechin wants to merge 2 commits intomainfrom
refactor/import-fixes
Open

fix: import system error handling, decompression, and correctness#783
datlechin wants to merge 2 commits intomainfrom
refactor/import-fixes

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Targeted fixes for the import system (architecture was already sound, unlike export which needed full rewrite)
  • 10 issues fixed: 2 critical, 5 major, 3 minor

Changes (9 files, +95/-84)

Critical fixes

  • SQLFileParser now returns AsyncThrowingStream instead of AsyncStream - file read and encoding errors are surfaced instead of silently succeeding with partial data
  • Compressed (.gz) files are decompressed once and shared between preview and import (was decompressing twice)

Major fixes

  • Transaction rollback error now correctly reported (was wrapping import error instead of rollback error)
  • FK checks properly restored after failed import with logging (was silently swallowing)
  • Progress estimate uses decompressed file size for accurate progress bar
  • NSOpenPanel queries import plugins for accepted file types instead of hardcoding .sql/.gz
  • FileDecompressor uses async GzipProcess instead of blocking waitUntilExit()

Minor fixes

  • Statement counting task cancelled on dialog dismiss
  • importFileURL cleared after dialog presented
  • Temp file extension derived from original filename (not hardcoded .sql)

Test plan

  • Import a .sql.gz file - verify single decompression, correct progress
  • Import a file with encoding error - verify error surfaced (not silent success)
  • Import with FK checks + transaction, trigger failure mid-import - verify rollback + FK restored
  • Cancel import mid-stream - verify clean dismissal
  • Reopen import dialog - verify no stale file pre-populated

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