Skip to content

Add null check for relation type map.#2114

Closed
rozele wants to merge 3 commits into
parse-community:masterfrom
rozele:patch-1
Closed

Add null check for relation type map.#2114
rozele wants to merge 3 commits into
parse-community:masterfrom
rozele:patch-1

Conversation

@rozele

@rozele rozele commented Jun 20, 2016

Copy link
Copy Markdown

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

codecov-io commented Jun 20, 2016

Copy link
Copy Markdown

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

ghost commented Jun 21, 2016

Copy link
Copy Markdown

@rozele updated the pull request.

1 similar comment
@ghost

ghost commented Jun 21, 2016

Copy link
Copy Markdown

@rozele updated the pull request.

@rozele

rozele commented Jun 23, 2016

Copy link
Copy Markdown
Author

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
Copy Markdown
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

rozele commented Jun 28, 2016

Copy link
Copy Markdown
Author

@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

rozele commented Jun 28, 2016

Copy link
Copy Markdown
Author

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
Copy Markdown
Contributor

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

@huskylovegold

Copy link
Copy Markdown

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
Copy Markdown
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