-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
getDatastore.manager issue in sails-mongo@2.1.0 #7314
Comments
@makeitcount 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. |
@DominusKelvin can you please review your PR for |
Great catch. I'll have a look. |
Can you try making it a promise because the underlying Mongo instance is no longer callback based but promise based. Also read the upgrade guide as it discusses the changes needed in userland code 👇🏾 |
I do not fully understand the change suggested here. The other exec callbacks are working fine for me. What is this iife change suggested here? How should the above code I mentioned should look like? |
Well .exec is Sails/Waterline code. .toArray is not. It's the underlying adapter so it needs to be a promise so .toArray().then().catch() The IIFE is meant to reduce the change you need but if converting to promise works for you then that's fine. |
Ok. So if I replace |
Yeah let me know if that works for you. General rule is if you are using the underlying MongoDB driver instance, you have to move to promises. If you have been using .exec on the other hand then no need to change anything. Let me know if that works for you then I can close this issue. |
Hey @makeitcount I'll be closing this issue as resolved since from our conversations you can resolve this in userland via a couple of suggested options. Cheers. |
Node version: 16.20.0
Sails version (sails): 1.5.8
ORM hook version (sails-hook-orm): 4.0.2
Sockets hook version (sails-hook-sockets): 2.0.4
Grunt hook version (sails-hook-grunt): 5.0.0
DB adapter & version (e.g. sails-mongo): 2.1.0
After recent upgrade of sails-mongo, following query stated failing without any warning/error and never returns the control back to the callback.
This works on
sails-mongo@2.0.0
(and node v14) but not not onsails-mongo@2.1.0
(and node v16)The text was updated successfully, but these errors were encountered: