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: upgrade knex from 2.4.0 to 2.4.2 #4309
Conversation
Also fixes new warnings with double rollbacks in transaction blocks
✅ Deploy Preview for peaceful-bassi-cbf284 canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IF e2e pass, it should be safe
}), | ||
); | ||
} catch (e) { | ||
trx.rollback(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we want those rollbacks ? are they applied automatically ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, knex handles that for us. This was a bad practice when we started using knex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right! About half way down this page: https://knexjs.org/guide/transactions.html
And in dev when the error happened it was inside this transaction block. And the knex threw another error (hiding the real one) saying "you're trying to exit a transaction that has already been closed" (or something like that).
This fixed the dev experience. It doesn't seem to happen in production though, which is curious
## [0.395.1](0.395.0...0.395.1) (2023-01-27) ### Bug Fixes * upgrade knex from 2.4.0 to 2.4.2 ([#4309](#4309)) ([4bb578c](4bb578c))
🎉 This PR is included in version 0.395.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Also fixes new warnings with double rollbacks in transaction blocks
2.4.0 contains a bug when inserting arrays: knex/knex#5365
Reviewing
The diff looks big but I've only made two changes:
try {} except {trx.rollback(e); throw e;}
from a bunch of transacting blocks