Add null check for relation type map.#2114
Add null check for relation type map.#2114rozele wants to merge 3 commits intoparse-community:masterfrom
Conversation
For relations that are not explicitly defined in the schema, we need a null check here.
Current coverage is 92.07%@@ 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
|
|
@rozele updated the pull request. |
1 similar comment
|
@rozele updated the pull request. |
|
The build for this has failed twice non-deterministically for two different mongo versions. I don't think this change caused the failure. |
|
Do you have a test/use case in particular that would be fixed by that PR? If so, please add it alongside the fix. |
|
@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. |
|
Here's the specific line that creates an exception on the server: So when 'mySchedule' does not yet exist for a new user, this will throw. |
|
There you have the test then! Can you please add it to the ParseQuery related tests? |
|
it work! |
|
I've added a test into #2319 |
For relations that are not explicitly defined in the schema, we need a null check here.