From da09ffd3fabc949383234c345b5fd5a83c455ef1 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 1 Apr 2016 13:37:21 -0700 Subject: [PATCH] [Persistence] Don't evict models on persist https://github.com/nasa/openmct/issues/745#issuecomment-204559209 --- platform/core/src/capabilities/PersistenceCapability.js | 3 --- .../core/test/capabilities/PersistenceCapabilitySpec.js | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/platform/core/src/capabilities/PersistenceCapability.js b/platform/core/src/capabilities/PersistenceCapability.js index 91c5147bfe..af21618ee3 100644 --- a/platform/core/src/capabilities/PersistenceCapability.js +++ b/platform/core/src/capabilities/PersistenceCapability.js @@ -149,9 +149,6 @@ define( getKey(domainObject.getId()), domainObject.getModel() ]).then(function(result){ - if (result) { - cacheService.remove(domainObject.getId()); - } return rejectIfFalsey(result, self.$q); }).catch(function(error){ return notifyOnError(error, domainObject, self.notificationService, self.$q); diff --git a/platform/core/test/capabilities/PersistenceCapabilitySpec.js b/platform/core/test/capabilities/PersistenceCapabilitySpec.js index d9b93c9e12..7e214db147 100644 --- a/platform/core/test/capabilities/PersistenceCapabilitySpec.js +++ b/platform/core/test/capabilities/PersistenceCapabilitySpec.js @@ -176,12 +176,8 @@ define( expect(mockQ.reject).not.toHaveBeenCalled(); expect(mockNofificationService.error).not.toHaveBeenCalled(); }); - - it("removes the model from the cache", function () { - persistence.persist(); - expect(mockCacheService.remove).toHaveBeenCalledWith(id); - }); }); + describe("unsuccessful persistence", function() { var sadPromise = { then: function(callback){