mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-29 03:43:16 +08:00
temp(streaming): Never consume deletions to messages
This commit is contained in:
parent
39cdb7abfa
commit
344524d259
1 changed files with 4 additions and 3 deletions
|
@ -157,7 +157,10 @@ class InboxAPI
|
||||||
for delta in destroy
|
for delta in destroy
|
||||||
console.log(" - 1 #{delta.object} (#{delta.id})")
|
console.log(" - 1 #{delta.object} (#{delta.id})")
|
||||||
klass = modelClassMap()[delta.object]
|
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.find(klass, delta.id).then (model) ->
|
||||||
DatabaseStore.unpersistModel(model) if model
|
DatabaseStore.unpersistModel(model) if model
|
||||||
|
|
||||||
|
@ -195,8 +198,6 @@ class InboxAPI
|
||||||
# For some reason, we occasionally get a delta with:
|
# For some reason, we occasionally get a delta with:
|
||||||
# delta.object = 'message', delta.attributes.object = 'draft'
|
# delta.object = 'message', delta.attributes.object = 'draft'
|
||||||
if classname is "draft" or model?.object is "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'
|
Message = require './models/message'
|
||||||
return @_shouldAcceptModelIfNewer(Message, model)
|
return @_shouldAcceptModelIfNewer(Message, model)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue