-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Break schemaController dependency. #1901
Break schemaController dependency. #1901
Conversation
expected = schema.getExpectedType(className, key); | ||
} | ||
if ((expected && expected.type == 'Pointer') || (!expected && restValue && restValue.__type == 'Pointer')) { | ||
if ((parseFormatSchema.fields[key] && parseFormatSchema.fields[key].type === 'Pointer') || (!parseFormatSchema.fields[key] && restValue && restValue.__type == 'Pointer')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be worth null checking parseFormatSchema
and parseFormatSchema.fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of the contract we are going to make with the DB adapters is that we always provide a valid schema. All validation is going to happen inside Parse Server, so if those are ever null, we should actually crash and not just go forward without knowing what the real schema is.
* upstream/master: (63 commits) Fixes parse-community#1649 (parse-community#1650) Update issue template (parse-community#1899) Break schemaController dependency. (parse-community#1901) Remove unnecessary null check Update schema mismatch error to include type string (parse-community#1898) Move more mongo specific stuff into mongo adapter Kill mongoOptions Consistent parameter order move transformWhere into mongo adapter Remove options from count Can't sort a count Remove limit from count Destructure mongo options remove adaptive collection call create + use adapter count instead of collection count transformWhere in MongoAdapter remove schemaController paramater Remove schemaController parameter Remove getRelationFields Remove all dependencies on schemaController ...
Break more dependencies on schemaController.
Also most some validation out of the adapter and into the server.