From e45292172955b48ba7fd033039840ee0296b9982 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 3 Jun 2015 13:09:23 -0700 Subject: [PATCH] [Core] Revise explicit setting of modified timestamp Allow undefined as an explicit value for a domain object's modification timestamp (as set via the mutation capability.) Avoids a bug in minimal auto-refresh, being added for WTD-1221. --- platform/core/src/capabilities/MutationCapability.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/core/src/capabilities/MutationCapability.js b/platform/core/src/capabilities/MutationCapability.js index 431c8d5d19..c20c90deab 100644 --- a/platform/core/src/capabilities/MutationCapability.js +++ b/platform/core/src/capabilities/MutationCapability.js @@ -77,7 +77,8 @@ define( // Get the object's model and clone it, so the // mutator function has a temporary copy to work with. var model = domainObject.getModel(), - clone = JSON.parse(JSON.stringify(model)); + clone = JSON.parse(JSON.stringify(model)), + useTimestamp = arguments.length > 1; // Function to handle copying values to the actual function handleMutation(mutationResult) { @@ -94,8 +95,7 @@ define( if (model !== result) { copyValues(model, result); } - model.modified = (typeof timestamp === 'number') ? - timestamp : now(); + model.modified = useTimestamp ? timestamp : now(); } // Report the result of the mutation