From b5ac2b5c4c8ba837b5545b1534cdcd6acdea4ffd Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 6 Aug 2015 12:22:24 -0700 Subject: [PATCH] fix(nylas-api): The _delta property was not correctly associated with deltas --- src/flux/nylas-api.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flux/nylas-api.coffee b/src/flux/nylas-api.coffee index ecad35ac1..67dace97b 100644 --- a/src/flux/nylas-api.coffee +++ b/src/flux/nylas-api.coffee @@ -260,7 +260,7 @@ class NylasAPI # Create a (non-enumerable) reference from the attributes which we carry forward # back to their original deltas. This allows us to mark the deltas that the # app ignores later in the process. - for delta in deltas + deltas.forEach (delta) -> if delta.attributes Object.defineProperty(delta.attributes, '_delta', { get: -> delta }) @@ -350,7 +350,7 @@ class NylasAPI DatabaseStore = require './stores/database-store' DatabaseStore.findVersions(klass, ids).then (versions) -> accepted = accepted.filter (json) -> - if versions[json.id] >= json.version + if json.version and versions[json.id] >= json.version json._delta?.ignoredBecause = "This version (#{json.version}) is not newer. Already have (#{versions[json.id]})" return false return true