Skip to content

Add null check for relation type map. #2114

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

Closed
wants to merge 3 commits into from

Conversation

rozele
Copy link

@rozele rozele commented Jun 20, 2016

For relations that are not explicitly defined in the schema, we need a null check here.

For relations that are not explicitly defined in the schema, we need a null check here.
@codecov-io
Copy link

codecov-io commented Jun 20, 2016

Current coverage is 92.07%

Merging #2114 into master will not change coverage

@@             master      #2114   diff @@
==========================================
  Files            93         93          
  Lines          6777       6777          
  Methods        1193       1193          
  Messages          0          0          
  Branches       1433       1433          
==========================================
  Hits           6240       6240          
  Misses          537        537          
  Partials          0          0          

Powered by Codecov. Last updated by 006540c...ef4b724

@ghost
Copy link

ghost commented Jun 21, 2016

@rozele updated the pull request.

1 similar comment
@ghost
Copy link

ghost commented Jun 21, 2016

@rozele updated the pull request.

@rozele
Copy link
Author

rozele commented Jun 23, 2016

The build for this has failed twice non-deterministically for two different mongo versions. I don't think this change caused the failure.

@flovilmart
Copy link
Contributor

Do you have a test/use case in particular that would be fixed by that PR? If so, please add it alongside the fix.

@rozele
Copy link
Author

rozele commented Jun 28, 2016

@flovilmart I don't have a particular test (I honestly don't know much about the parse-server), but if you look at line line 550 (https://github.com/ParsePlatform/parse-server/blob/master/src/Controllers/DatabaseController.js#L550), you'll see that a null check for expected type in the schema is not unprecedented. I found this issue while debugging a particular use case for the f8app (https://github.com/fbsamples/f8app). When you try to query for a relation that does not yet exist, an exception occurs.

@rozele
Copy link
Author

rozele commented Jun 28, 2016

Here's the specific line that creates an exception on the server:
https://github.com/fbsamples/f8app/blob/master/js/actions/schedule.js#L103

So when 'mySchedule' does not yet exist for a new user, this will throw.

@flovilmart
Copy link
Contributor

There you have the test then! Can you please add it to the ParseQuery related tests?

@Shangyunliang
Copy link

it work!

@flovilmart flovilmart modified the milestone: 2.2.17 Jul 12, 2016
caoer added a commit to caoer/parse-server that referenced this pull request Jul 18, 2016
@flovilmart
Copy link
Contributor

I've added a test into #2319

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