Git Product home page Git Product logo

Comments (9)

sailsbot avatar sailsbot commented on June 16, 2024

@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:

  • look for a workaround. (Even if it's just temporary, sharing your solution can save someone else a lot of time and effort.)
  • tell us why this issue is important to you and your team. What are you trying to accomplish? (Submissions with a little bit of human context tend to be easier to understand and faster to resolve.)
  • make sure you've provided clear instructions on how to reproduce the bug from a clean install.
  • double-check that you've provided all of the requested version and dependency information. (Some of this info might seem irrelevant at first, like which database adapter you're using, but we ask that you include it anyway. Oftentimes an issue is caused by a confluence of unexpected factors, and it can save everybody a ton of time to know all the details up front.)
  • read the code of conduct.
  • if appropriate, ask your business to sponsor your issue. (Open source is our passion, and our core maintainers volunteer many of their nights and weekends working on Sails. But you only get so many nights and weekends in life, and stuff gets done a lot faster when you can work on it during normal daylight hours.)
  • let us know if you are using a 3rd party plugin; whether that's a database adapter, a non-standard view engine, or any other dependency maintained by someone other than our core team. (Besides the name of the 3rd party package, it helps to include the exact version you're using. If you're unsure, check out this list of all the core packages we maintain.)

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.

from sails.

makeitcount avatar makeitcount commented on June 16, 2024

@DominusKelvin can you please review your PR for [email protected] once again? I just commented on the code which might have caused this issue (I believe so because I debugged that using breakpoint but I don't have any idea how to fix that)

from sails.

DominusKelvin avatar DominusKelvin commented on June 16, 2024

@DominusKelvin can you please review your PR for [email protected] once again? I just commented on the code which might have caused this issue (I believe so because I debugged that using breakpoint but I don't have any idea how to fix that)

Great catch. I'll have a look.

from sails.

DominusKelvin avatar DominusKelvin commented on June 16, 2024

@DominusKelvin can you please review your PR for [email protected] once again? I just commented on the code which might have caused this issue (I believe so because I debugged that using breakpoint but I don't have any idea how to fix that)

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 👇🏾

https://blog.sailscasts.com/sails-mongo-v2-1-0

from sails.

makeitcount avatar makeitcount commented on June 16, 2024

https://blog.sailscasts.com/sails-mongo-v2-1-0

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?

from sails.

DominusKelvin avatar DominusKelvin commented on June 16, 2024

https://blog.sailscasts.com/sails-mongo-v2-1-0

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.

from sails.

makeitcount avatar makeitcount commented on June 16, 2024

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()

Ok. So if I replace .toArray() with .exec(function(err, results){}), that will also work, right?
If this is possible then it would be easier to keep things consistent across the codebase i.e. callback only.

from sails.

DominusKelvin avatar DominusKelvin commented on June 16, 2024

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()

Ok. So if I replace .toArray() with .exec(function(err, results){}), that will also work, right?

If this is possible then it would be easier to keep things consistent across the codebase i.e. callback only.

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.

from sails.

DominusKelvin avatar DominusKelvin commented on June 16, 2024

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.

from sails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.