Skip to content

fix: preserve loadFile transaction errors - #315

Open
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/308-preserve-load-file-errors
Open

fix: preserve loadFile transaction errors#315
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/308-preserve-load-file-errors

Conversation

@huytdps13400

Copy link
Copy Markdown

Summary

  • give importSqlFile() one transaction-finalization scope instead of rolling back in nested catches
  • rely on RAII to close the input stream
  • roll back only after a successful BEGIN and before a successful COMMIT
  • preserve file, line, command, and primary SQLite error context
  • append rollback failures without masking the original import failure
  • add an iOS harness fixture proving rollback and connection reuse

The regression is registered only on iOS because its fixture path is supplied from the bundled iOS example resource. The production fix is shared C++ and was also compiled through the Android app build.

Verification

  • focused iOS harness RED before fix: error lacked Could not load file: context
  • focused iOS harness GREEN after fix: 1 passed
  • full iOS react-native-harness: 3 suites, 69 tests passed
  • iOS native app build: succeeded
  • Android :app:assembleDebug for arm64-v8a: succeeded
  • bun typecheck (all three workspaces)
  • Prettier and clang-format checks
  • git diff --check
  • no lockfile changes

Closes #308.

Give importSqlFile one transaction-finalization path, retain failing command context, and append rollback failures without masking the primary cause. Closes margelo#308.
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.

loadFile masks statement errors by rolling back twice

1 participant