Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: knexjs edge case on transaction #459

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Apr 23, 2024

What kind of change does this PR introduce?

Bug fix

What is the current behaviour?

When there is an error during the creation of a transaction, there is a bug in knex knex/knex#4709 where the error is not consistent and propagated.

What is the new behaviour?

This PR patches this weird behaviour by awaiting the exectionPromise if the transaction is already marked as completed. Forcing the exception to bubble up.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8797438243

Details

  • 1 of 20 (5.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.08%) to 79.087%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/http/error-handler.ts 0 1 0.0%
src/database/connection.ts 1 19 5.26%
Totals Coverage Status
Change from base Build 8734374033: -0.08%
Covered Lines: 11906
Relevant Lines: 14919

💛 - Coveralls

@fenos fenos merged commit 2ee8828 into master Apr 24, 2024
1 check passed
@fenos fenos deleted the db/propagate-transaction-error-edge-case branch April 24, 2024 07:19
Copy link

🎉 This PR is included in version 1.0.11 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants