Updating with two GeoPoints fails correctly. (#4162)

This commit is contained in:
Anthony Mosca
2017-09-19 20:42:40 +09:30
committed by Florent Vilmart
parent 406a21e967
commit cf630ba462
3 changed files with 29 additions and 6 deletions

View File

@@ -661,9 +661,11 @@ export default class SchemaController {
return this._dbAdapter.addFieldIfNotExists(className, fieldName, type).then(() => {
// The update succeeded. Reload the schema
return this.reloadData({ clearCache: true });
}, () => {
//TODO: introspect the error and only reload if the error is one for which is makes sense to reload
}, (error) => {
if (error.code == Parse.Error.INCORRECT_TYPE) {
// Make sure that we throw errors when it is appropriate to do so.
throw error;
}
// The update failed. This can be okay - it might have been a race
// condition where another client updated the schema in the same
// way that we wanted to. So, just reload the schema