@@ -807,8 +807,9 @@ export default class SchemaController {
807
807
className,
808
808
} )
809
809
) ;
810
+ // TODO: Remove by updating schema cache directly
811
+ await this . reloadData ( { clearCache : true } ) ;
810
812
const parseSchema = convertAdapterSchemaToParseSchema ( adapterSchema ) ;
811
- SchemaCache . set ( className , parseSchema ) ;
812
813
return parseSchema ;
813
814
} catch ( error ) {
814
815
if ( error && error . code === Parse . Error . DUPLICATE_VALUE ) {
@@ -934,7 +935,6 @@ export default class SchemaController {
934
935
return (
935
936
// The schema update succeeded. Reload the schema
936
937
this . addClassIfNotExists ( className )
937
- . then ( ( ) => this . reloadData ( ) )
938
938
. catch ( ( ) => {
939
939
// The schema update failed. This can be okay - it might
940
940
// have failed because there's a race condition and a different
@@ -1125,13 +1125,6 @@ export default class SchemaController {
1125
1125
return Promise . resolve ( ) ;
1126
1126
} )
1127
1127
. then ( ( ) => {
1128
- const cached = SchemaCache . get ( className ) ;
1129
- if ( cached ) {
1130
- if ( cached && ! cached . fields [ fieldName ] ) {
1131
- cached . fields [ fieldName ] = type ;
1132
- SchemaCache . set ( className , cached ) ;
1133
- }
1134
- }
1135
1128
return {
1136
1129
className,
1137
1130
fieldName,
@@ -1258,7 +1251,8 @@ export default class SchemaController {
1258
1251
const enforceFields = results . filter ( result => ! ! result ) ;
1259
1252
1260
1253
if ( enforceFields . length !== 0 ) {
1261
- await this . reloadData ( ) ;
1254
+ // TODO: Remove by updating schema cache directly
1255
+ await this . reloadData ( { clearCache : true } ) ;
1262
1256
}
1263
1257
this . ensureFields ( enforceFields ) ;
1264
1258
0 commit comments