Skip to content

fix: roll back failed transaction commits - #316

Open
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/307-rollback-failed-commit
Open

fix: roll back failed transaction commits#316
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/307-rollback-failed-commit

Conversation

@huytdps13400

Copy link
Copy Markdown

Summary

  • replace the ambiguous isFinished flag with explicit transaction finalization states
  • mark commits and rollbacks complete only after their SQL succeeds
  • allow a failed commit to enter the rollback path
  • preserve the original commit error and expose both errors through an AggregateError if rollback also fails
  • cover automatic and manual commit failures using deferred foreign-key constraints

Verification

  • focused iOS harness RED before fix: both cases retained the invalid child row after COMMIT failed
  • focused iOS harness GREEN: 2 passed
  • full iOS unit harness: 34 passed
  • TypeORM harness: 1 passed
  • bun typecheck (all three workspaces)
  • bun lint
  • repository-wide Prettier check
  • git diff --check
  • no lockfile changes

Closes #307.

Track transaction finalization states explicitly and preserve commit failures while rolling back deferred constraint errors. Closes margelo#307.
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.

Failed COMMIT leaves transaction open and breaks subsequent transactions

1 participant