From af6e6e669a69875657ace03f405df02d0d8684f1 Mon Sep 17 00:00:00 2001 From: Halla Moore Date: Fri, 31 Mar 2017 11:12:50 -0700 Subject: [PATCH] [client-sync] Wrap more syncWorker args Turns out the SyncWorker isn't the only one who initiates SyncTasks --- .../syncback-tasks/ensure-message-in-sent-folder.imap.es6 | 4 ++-- .../syncback-tasks/move-thread-to-folder.imap.es6 | 2 +- .../syncback-tasks/set-thread-folder-and-labels.imap.es6 | 2 +- .../syncback-tasks/sync-unknown-uids.imap.es6 | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client-sync/src/local-sync-worker/syncback-tasks/ensure-message-in-sent-folder.imap.es6 b/packages/client-sync/src/local-sync-worker/syncback-tasks/ensure-message-in-sent-folder.imap.es6 index 6a927ab38..78a851a4e 100644 --- a/packages/client-sync/src/local-sync-worker/syncback-tasks/ensure-message-in-sent-folder.imap.es6 +++ b/packages/client-sync/src/local-sync-worker/syncback-tasks/ensure-message-in-sent-folder.imap.es6 @@ -52,7 +52,7 @@ async function* saveSentMessage({db, account, syncWorker, logger, imap, provider account, folder: sentFolder, }) - yield syncOperation.run(db, imap, syncWorker) + yield syncOperation.run(db, imap, {syncWorker}) return } @@ -91,7 +91,7 @@ async function* saveSentMessage({db, account, syncWorker, logger, imap, provider account, folder: allMailFolder, }) - yield syncOperation.run(db, imap, syncWorker) + yield syncOperation.run(db, imap, {syncWorker}) } async function* setThreadingReferences(db, baseMessage) { diff --git a/packages/client-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.es6 b/packages/client-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.es6 index c199f21cd..d28330cff 100644 --- a/packages/client-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.es6 +++ b/packages/client-sync/src/local-sync-worker/syncback-tasks/move-thread-to-folder.imap.es6 @@ -55,7 +55,7 @@ class MoveThreadToFolderIMAP extends SyncbackIMAPTask { account: this._account, folder: targetFolder, }) - yield syncOperation.run(db, imap, syncWorker) + yield syncOperation.run(db, imap, {syncWorker}) } } module.exports = MoveThreadToFolderIMAP diff --git a/packages/client-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.es6 b/packages/client-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.es6 index 24d61661e..23cc52267 100644 --- a/packages/client-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.es6 +++ b/packages/client-sync/src/local-sync-worker/syncback-tasks/set-thread-folder-and-labels.imap.es6 @@ -60,7 +60,7 @@ class SetThreadFolderAndLabelsIMAP extends SyncbackIMAPTask { account: this._account, folder: targetFolder, }) - yield syncOperation.run(db, imap, syncWorker) + yield syncOperation.run(db, imap, {syncWorker}) } } module.exports = SetThreadFolderAndLabelsIMAP diff --git a/packages/client-sync/src/local-sync-worker/syncback-tasks/sync-unknown-uids.imap.es6 b/packages/client-sync/src/local-sync-worker/syncback-tasks/sync-unknown-uids.imap.es6 index b42609f66..e1629a060 100644 --- a/packages/client-sync/src/local-sync-worker/syncback-tasks/sync-unknown-uids.imap.es6 +++ b/packages/client-sync/src/local-sync-worker/syncback-tasks/sync-unknown-uids.imap.es6 @@ -47,7 +47,7 @@ class SyncUnknownUIDs extends SyncbackIMAPTask { uids: uidsToSync, }); this._syncOperation.on('message-processed', () => this.onMessageProcessed()); - yield this._syncOperation.run(db, imap, syncWorker) + yield this._syncOperation.run(db, imap, {syncWorker}) this._syncOperation.removeAllListeners('message-processed'); if (yield this._isCancelled()) {