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
Something strange in transaction() #6805
Comments
@alxndrsn Thanks for posting! We'll take a look as soon as possible. In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly. For help with questions about Sails, click here. |
@alxndrsn Thanks a lot for bringing attention to this logic curiosity. Will bring it up with the team for analysis of the best approach to have transaction() complete. Appreciate the handful of workarounds I'll get back with you with the decision 👍 Any further community feedback / experiences are welcome for this one. |
@mikermcneil @MadisonHicks Just in case you haven't seen it, I think this is my favourite bug 😉 |
I've just run into this again with a three-argument function preceded by |
This can be avoided by replacing:
with
and defining the additional function:
|
😱 @mikermcneil what's that code doing? Checking if the
? |
For reference if facing similar mysteries, this code's repeated in:
|
Example PR for the core sails instances: #7017 |
Node version:
Sails version (sails): 1.2.3
ORM hook version (sails-hook-orm): 2.1.1
Sockets hook version (sails-hook-sockets):
Organics hook version (sails-hook-organics):
Grunt hook version (sails-hook-grunt):
Uploads hook version (sails-hook-uploads):
DB adapter & version (e.g. sails-mysql@5.55.5): sails-postgresql 1.0.2
Skipper adapter & version (e.g. skipper-s3@5.55.5):
Steps to recreate:
Observed:
Transaction never completes for this controller:
Adding a
console.log()
inside the controller allows the transaction to complete:Another way of fixing the problem is to remove one of the arguments from
fn(...)
:or, changing the argument to a string:
Another fix is to remove the argument for the transaction callback:
?!?!?!?!?!
Conclusion
If there is a single function call inside a transaction with two or fewer arguments of certain values, then the transaction is never completed.
The text was updated successfully, but these errors were encountered: