Skip to content
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

[fixes #6979] Fix input not normalising to ObjectId for certain query operators #484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rua-Yuki
Copy link
Contributor

This PR fixes balderdashy/sails#6979.

All tests appear to be passing locally. Further, these changes don't appear to have caused any problems with our large app/test suites.

I'd like to have tests added to validate this behaviour and prevent any sort of regression; would balderdashy/waterline-adapter-tests be the correct place to have this done, or should we create only adapter-specific tests here?

The following operators were affected and did not have suitable input
values normalised to ObjectId instances prior:
  • >
  • <
  • >=
  • <=

A tryNormalizeMongoObjectId helper function was added to minimise
repetition while implementing this fix.
@sailsbot
Copy link
Collaborator

Thanks for submitting this pull request, @Rua-Yuki! We'll look at it ASAP.

In the mean time, here are some ways you can help speed things along:

  • discuss this pull request with other contributors and get their feedback. (Reactions and comments can help us make better decisions, anticipate compatibility problems, and prevent bugs.)
  • ask another JavaScript developer to review the files changed in this pull request. (Peer reviews definitely don't guarantee perfection, but they help catch mistakes and enourage collaborative thinking. Code reviews are so useful that some open source projects require a minimum number of reviews before even considering a merge!)
  • if appropriate, ask your business to sponsor your pull request. (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.)
  • make sure you've answered the "why?" (Before we can review and merge a pull request, we feel it is important to fully understand the use case: the human reason these changes are important for you, your team, or your organization.)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Waterline's sails-mongo adapter fails to convert query input to ObjectId when applying certain operators
2 participants