From 151510b823e970f543079f3960bfa08d280106d9 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Mon, 16 Jan 2017 19:17:27 -0800 Subject: [PATCH] fix(send): temporarily disable ensureOnce protection Since we catch any post-send errors now in K2 and if there is a temporary error, this protection won't let you send a message again --- src/flux/tasks/send-draft-task.es6 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/flux/tasks/send-draft-task.es6 b/src/flux/tasks/send-draft-task.es6 index f327895a0..ab842e3fb 100644 --- a/src/flux/tasks/send-draft-task.es6 +++ b/src/flux/tasks/send-draft-task.es6 @@ -36,10 +36,6 @@ const LINK_TRACKING_ID = NylasEnv.packages.pluginIdFor('link-tracking') * listening to is currently not saved to disk. This means that * SendDraftTask will never know when or if the corresponding K2 * SyncbackTask ever finished. - * - * Not knowing this it will try and send the task again, but fail due to - * the ensureOnce protection we have preventing API requests from running - * twice. */ export default class SendDraftTask extends BaseDraftTask { @@ -131,7 +127,7 @@ export default class SendDraftTask extends BaseDraftTask { method: 'POST', body: this.draft.toJSON(), timeout: 1000 * 60 * 5, // We cannot hang up a send - won't know if it sent - ensureOnce: true, + ensureOnce: false, // TODO We disabled ensureOnce since K2 handles the task now requestId: this.draft.clientId, onSyncbackRequestCreated: (syncbackRequest) => { this._syncbackRequestId = syncbackRequest.id