The Object API should propagate out fresh model to any observers when .get() is called #4305 (#4325)

This commit is contained in:
Nikhil 2021-10-18 13:01:41 -07:00 committed by GitHub
parent 4c9c084eec
commit ea8c9c7cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,6 +182,12 @@ ObjectAPI.prototype.get = function (identifier, abortSignal) {
let objectPromise = provider.get(identifier, abortSignal).then(result => {
delete this.cache[keystring];
result = this.applyGetInterceptors(identifier, result);
if (result.isMutable) {
result.$refresh(result);
} else {
let mutableDomainObject = this._toMutable(result);
mutableDomainObject.$refresh(result);
}
return result;
});