fix(message-bodies): Ensure each message body is processed

Relevant for #436
This commit is contained in:
Ben Gotow 2015-11-20 18:03:47 -08:00
parent d1e9b93b64
commit d437e6866f

View file

@ -24,7 +24,7 @@ class MessageBodyProcessor
# optimistically display the message before the latest changes
# persisted.
_key: (message) ->
return crypto.createHash('md5').update(message.body).digest('hex')
return message.id + crypto.createHash('md5').update(message.body ? "").digest('hex')
version: ->
@_version
@ -38,6 +38,8 @@ class MessageBodyProcessor
process: (message) =>
body = message.body
return "" unless body
key = @_key(message)
if @_recentlyProcessedD[key]
return @_recentlyProcessedD[key].body