From f98b9449bf0250626781f1ef0202b066d46f64f2 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Thu, 26 Jan 2017 09:19:17 -0800 Subject: [PATCH] [local-sync] Fix transaction syntax --- .../syncback-tasks/move-thread-to-folder.imap.js | 2 +- .../syncback-tasks/set-thread-folder-and-labels.imap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/local-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.js b/packages/local-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.js index 50f2b9ab7..dd9ccad85 100644 --- a/packages/local-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.js +++ b/packages/local-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.js @@ -49,7 +49,7 @@ class MoveThreadToFolderIMAP extends SyncbackTask { // If IMAP succeeds, save the model updates await sequelize.transaction(async (transaction) => { await Promise.all(threadMessages.map(async (m) => { - await m.update({folderImapUID: null}, transaction) + await m.update({folderImapUID: null}, {transaction}) await m.setFolder(targetFolder, {transaction}) })) await thread.setFolders([targetFolder], {transaction}) diff --git a/packages/local-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.js b/packages/local-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.js index 2a2b0ee73..5aff8ca92 100644 --- a/packages/local-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.js +++ b/packages/local-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.js @@ -53,7 +53,7 @@ class SetThreadFolderAndLabelsIMAP extends SyncbackTask { // If IMAP succeeds, save the model updates await sequelize.transaction(async (transaction) => { await Promise.all(threadMessages.map(async (m) => { - await m.update({folderImapUID: null}, transaction) + await m.update({folderImapUID: null}, {transaction}) await m.setLabels(labelIds, {transaction}) await m.setFolder(targetFolder, {transaction}) }))