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(types): add missing transaction typescript types (v5) #11621
fix(types): add missing transaction typescript types (v5) #11621
Conversation
Codecov Report
@@ Coverage Diff @@
## v5 #11621 +/- ##
=======================================
Coverage 96.27% 96.27%
=======================================
Files 94 94
Lines 9187 9187
=======================================
Hits 8845 8845
Misses 342 342 Continue to review full report at Codecov.
|
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.
@aecorredor great job
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.
LGTM, same as #11620
🎉 This PR is included in version 5.21.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
When I try to use 5.21.2, I'm seeing these errors on compilation:
Is this expected? |
Definitely not expected, this is surprising, I thought our tests would have picked this up. Are you using some specific version of typescript or something that to the best of your knowledge could be involved in this? |
Ah, upgrading to Weird. Thanks for suggesting that. |
😬 Awesome. To be honest I didn't expect it to be that simple... |
I am getting the error
My packages
should i downgrade my typescript to |
@notoriousmango Please try downgrading and let us know if it works. Note: this is just in order to help us figure it out, of course Sequelize should work with the latest TS. We shall figure it out. |
@papb Sorry, my global typescript was outdated. |
Running TypeScript version 3.1 as per docs lead to the compilation error as per this issue: sequelize#11621 (comment)
Pull Request check-list
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
As stated in the sequelize docs (https://sequelize.org/master/class/lib/transaction.js~Transaction.html#static-get-LOCK), when performing find operations, a lock property can be passed, and that can be either
true
orfalse
or also a lock level obtained from the actual instance, i.e.t1.LOCK.UPDATE
, which ends up being a string.The TypeScript types were failing when trying to pass a boolean value to
lock
or when trying to accesst1.LOCK...
on a transaction instance.This PR adds those missing types.
Link to existing issue: #11178 (comment)
Link to v6-beta PR: #11620