Skip to content

Roll back failed transaction commits - #27

Merged
simolus3 merged 1 commit into
powersync-ja:mainfrom
julianallchin:fix-failed-commit-rollback
Sep 10, 2026
Merged

Roll back failed transaction commits#27
simolus3 merged 1 commit into
powersync-ja:mainfrom
julianallchin:fix-failed-commit-rollback

Conversation

@julianallchin

Copy link
Copy Markdown
Contributor

What changed

  • keep the transaction guard active until COMMIT succeeds
  • add a deferred foreign-key regression that verifies rollback and connection reuse

Root cause

A deferred constraint can fail at commit and leave SQLite inside the transaction. The guard previously disabled rollback before attempting the commit, so later writes failed with Connection already in transaction.

This isolates the failed-commit fix included in #22 without adding public APIs.

Validation

  • cargo +1.97.1 test -p powersync
  • cargo +1.97.1 clippy -p powersync --all-targets -- -D warnings

The regression fails before the fix and passes afterward.

@julianallchin
julianallchin marked this pull request as ready for review September 10, 2026 00:54

@simolus3 simolus3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@simolus3
simolus3 merged commit 90a91e7 into powersync-ja:main Sep 10, 2026
2 checks passed
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.

2 participants