Skip to content

Commit 50f7118

Browse files
committed
remove schema cleanup
1 parent f034211 commit 50f7118

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/Controllers/SchemaController.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,9 @@ export default class SchemaController {
807807
className,
808808
})
809809
);
810+
// TODO: Remove by updating schema cache directly
811+
await this.reloadData({ clearCache: true });
810812
const parseSchema = convertAdapterSchemaToParseSchema(adapterSchema);
811-
SchemaCache.set(className, parseSchema);
812813
return parseSchema;
813814
} catch (error) {
814815
if (error && error.code === Parse.Error.DUPLICATE_VALUE) {
@@ -934,7 +935,6 @@ export default class SchemaController {
934935
return (
935936
// The schema update succeeded. Reload the schema
936937
this.addClassIfNotExists(className)
937-
.then(() => this.reloadData())
938938
.catch(() => {
939939
// The schema update failed. This can be okay - it might
940940
// have failed because there's a race condition and a different
@@ -1125,13 +1125,6 @@ export default class SchemaController {
11251125
return Promise.resolve();
11261126
})
11271127
.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-
}
11351128
return {
11361129
className,
11371130
fieldName,
@@ -1258,7 +1251,8 @@ export default class SchemaController {
12581251
const enforceFields = results.filter(result => !!result);
12591252

12601253
if (enforceFields.length !== 0) {
1261-
await this.reloadData();
1254+
// TODO: Remove by updating schema cache directly
1255+
await this.reloadData({ clearCache: true });
12621256
}
12631257
this.ensureFields(enforceFields);
12641258

0 commit comments

Comments
 (0)