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 #1271 #1295

Merged
merged 2 commits into from
Mar 31, 2016
Merged

Fixes #1271 #1295

merged 2 commits into from
Mar 31, 2016

Conversation

drew-gross
Copy link
Contributor

No description provided.

query.objectId['$in'] = [...new Set(queryIn)];

// Need to make sure we don't clobber existing $lt or other constraints on objectId
if (!('objectId' in query) || typeof query.objectId === 'string') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move that up? be tough to follow why it's correct to override when typeof query.objectId === 'string' as it's a case managed on L493.

@codecov-io
Copy link

Current coverage is 93.01%

Merging #1295 into master will increase coverage by +0.01% as of 6599805

@@            master   #1295   diff @@
======================================
  Files           84      84       
  Stmts         5275    5280     +5
  Branches       960     964     +4
  Methods          0       0       
======================================
+ Hit           4906    4911     +5
  Partial         11      11       
  Missed         358     358       

Review entire Coverage Diff as of 6599805

Powered by Codecov. Updated on successful CI builds.

// Need to make sure we don't clobber existing $lt or other constraints on objectId
// Need to make sure we don't clobber existing $lt or other constraints on objectId.
// Clobbering $eq, $in and shorthand $eq (query.objectId === 'string') constraints
// is expected though.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drew-gross @flovilmart
I ran into an issue migrating an app to Parse Server and I'm hoping you can shed some light on this. You can see the failing test I wrote here. On api.parse.com and Parse Server <= 2.2.4 this test passes.

I tracked the problem down to this comment. Should we really be clobbering $eq constraints here or should the test linked above pass? The hacky feeling workaround would be to replace query.equalTo("objectId", cake1.id) with query.containedIn("objectId", [cake1.id]) in my test.

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeremyPlease I believe the test should pass as the query construction seem to be valid. Do you have an idea for the fix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flovilmart Check out #2472 and let me know what you think.

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

Successfully merging this pull request may close these issues.

4 participants