From 344524d25926651bdf781fc1af4c51055c554431 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Fri, 20 Feb 2015 14:39:02 -0800 Subject: [PATCH] temp(streaming): Never consume deletions to messages --- src/flux/inbox-api.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/flux/inbox-api.coffee b/src/flux/inbox-api.coffee index 3735f94bb..29ac7ab2f 100644 --- a/src/flux/inbox-api.coffee +++ b/src/flux/inbox-api.coffee @@ -157,7 +157,10 @@ class InboxAPI for delta in destroy console.log(" - 1 #{delta.object} (#{delta.id})") klass = modelClassMap()[delta.object] - return unless klass + continue unless klass + # TODO NEVER ACCEPT DRAFT DELETIONS BECAUSE THE SERVER GETS DELETE HAPPY + # WHEN YOU'RE COMPOSING A DRAFT. DELETE THIS ASAP + continue if klass is 'message' DatabaseStore.find(klass, delta.id).then (model) -> DatabaseStore.unpersistModel(model) if model @@ -195,8 +198,6 @@ class InboxAPI # For some reason, we occasionally get a delta with: # delta.object = 'message', delta.attributes.object = 'draft' if classname is "draft" or model?.object is "draft" - # TODO NEVER ACCEPT DRAFT CHANGES BECAUSE THE SERVER GETS DELETE HAPPY - return Promise.reject() Message = require './models/message' return @_shouldAcceptModelIfNewer(Message, model)