Always put in cache on mutation, assuming persistence

This commit is contained in:
Pete Richards 2016-11-08 14:58:15 -08:00
parent d74eba1922
commit 66a6b6d89b

View File

@ -39,6 +39,8 @@ define([], function () {
mutationTopic.listen(function (domainObject) {
var persistence = domainObject.getCapability('persistence');
var wasActive = transactionService.isActive();
cacheService.put(domainObject.getId(), domainObject.getModel());
if (persistence.persisted()) {
if (!wasActive) {
transactionService.startTransaction();
@ -51,8 +53,6 @@ define([], function () {
);
}
cacheService.put(domainObject.getId(), domainObject.getModel());
function unlistenAndCall(f) {
return function () {
if (MUTATION_TRACKER.has(domainObject)) {