Bring across fixes for #1468 and #2277 into TCR (#2386)

This commit is contained in:
Andrew Henry
2019-04-24 16:01:45 -07:00
committed by Pegah Sarram
parent f01d4071a1
commit d2e2d55caf
4 changed files with 69 additions and 78 deletions

View File

@ -77,14 +77,19 @@ define([], function () {
return promiseFn().then(nextFn);
};
}
if (!this.isScheduled(id)) {
this.clearTransactionFns[id] =
this.transactionService.addToTransaction(
chain(onCommit, release),
chain(onCancel, release)
);
/**
* Clear any existing persistence calls for object with given ID. This ensures only the most recent persistence
* call is executed. This should prevent stale objects being persisted and overwriting fresh ones.
*/
if (this.isScheduled(id)) {
this.clearTransactionsFor(id);
}
this.clearTransactionFns[id] =
this.transactionService.addToTransaction(
chain(onCommit, release),
chain(onCancel, release)
);
};
/**