diff --git a/packages/client-app/internal_packages/worker-ui/lib/developer-bar.cjsx b/packages/client-app/internal_packages/worker-ui/lib/developer-bar.cjsx index d2e9c7cd2..4ed966562 100644 --- a/packages/client-app/internal_packages/worker-ui/lib/developer-bar.cjsx +++ b/packages/client-app/internal_packages/worker-ui/lib/developer-bar.cjsx @@ -5,6 +5,7 @@ React = require 'react' TaskQueue, Actions, Contact, + Utils, Message} = require 'nylas-exports' {InjectedComponentSet} = require 'nylas-component-kit' @@ -153,7 +154,7 @@ class DeveloperBar extends React.Component @setState(section: section) _getStateFromStores: => - queue: TaskQueue._queue + queue: Utils.deepClone(TaskQueue._queue) completed: TaskQueue._completed curlHistory: DeveloperBarStore.curlHistory() longPollHistory: DeveloperBarStore.longPollHistory() diff --git a/packages/client-sync/src/message-processor/index.js b/packages/client-sync/src/message-processor/index.js index 5791aa6cd..925bbac98 100644 --- a/packages/client-sync/src/message-processor/index.js +++ b/packages/client-sync/src/message-processor/index.js @@ -274,7 +274,21 @@ class MessageProcessor { async _processExistingMessage({existingMessage, messageValues, struct} = {}) { const {accountId} = messageValues; const db = await LocalDatabaseConnector.forAccount(accountId); - await existingMessage.update(messageValues); + + /** + * There should never be a reason to update the body of a message + * already in the database. + * + * When we use link/open tracking on Gmail, we optimistically create a + * Message whose body is stripped of tracking pixels (so you don't + * self trigger). Since it takes time to delete the old draft on Gmail + * & restuff, it's possible to sync a message with a non-stripped body + * (which would cause you to self-trigger)). This prevents this from + * happening. + */ + const newMessageWithoutBody = _.clone(messageValues) + delete newMessageWithoutBody.body; + await existingMessage.update(newMessageWithoutBody); if (messageValues.labels && messageValues.labels.length > 0) { await existingMessage.setLabels(messageValues.labels) }