Skip to content

Commit d4ea5ea

Browse files
committed
fix options bug
1 parent ecd9913 commit d4ea5ea

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Controllers/DatabaseController.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,18 +361,15 @@ const relationSchema = {
361361

362362
class DatabaseController {
363363
adapter: StorageAdapter;
364-
idempotencyOptions: any;
365364
schemaCache: any;
366365
schemaPromise: ?Promise<SchemaController.SchemaController>;
367366
_transactionalSession: ?any;
368367
options: ParseServerOptions;
369368

370369
constructor(adapter: StorageAdapter, options: ParseServerOptions) {
371370
this.adapter = adapter;
372-
this.idempotencyOptions = options.idempotencyOptions || {};
373-
// We don't want a mutable this.schema, because then you could have
374-
// one request that uses different schemas for different parts of
375-
// it. Instead, use loadSchema to get a schema.
371+
// Prevent mutable this.schema, otherwise one request could use
372+
// multiple schemas, so instead use loadSchema to get a schema.
376373
this.schemaPromise = null;
377374
this._transactionalSession = null;
378375
this.options = options;
@@ -1737,7 +1734,7 @@ class DatabaseController {
17371734
ttl: 0,
17381735
};
17391736
} else if (isPostgresAdapter) {
1740-
options = this.idempotencyOptions;
1737+
options = (this.options || {}).idempotencyOptions || {};
17411738
options.setIdempotencyFunction = true;
17421739
}
17431740
await this.adapter

0 commit comments

Comments
 (0)