mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
Fix bug where always closing connection after sync
This commit is contained in:
parent
0189e3e77d
commit
c7422ffaea
|
@ -13,5 +13,5 @@ module.exports = {
|
|||
reply(Serialization.jsonStringify(syncbackRequest))
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ const notifyAccountIsActive = (accountId) => {
|
|||
if (val === 1) {
|
||||
PubsubConnector.notify({
|
||||
accountId: accountId,
|
||||
type: MessageTypes.ACCOUNT_UPDATED
|
||||
type: MessageTypes.ACCOUNT_UPDATED,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const {
|
||||
Provider,
|
||||
SchedulerUtils,
|
||||
IMAPConnection,
|
||||
PubsubConnector,
|
||||
|
@ -74,16 +73,18 @@ class SyncWorker {
|
|||
.then((inboxCategory) => this._conn.openBox(inboxCategory.name))
|
||||
.then(() => console.log('SyncWorker: - Idling on inbox category'))
|
||||
.catch((error) => {
|
||||
this.closeConnection()
|
||||
console.error('SyncWorker: - Unhandled error while attempting to idle on Inbox after sync: ', error)
|
||||
this.closeConnection()
|
||||
})
|
||||
} else if (afterSync === 'close') {
|
||||
console.log('SyncWorker: - Closing connection');
|
||||
} else {
|
||||
console.warn(`SyncWorker: - Unknown afterSync behavior: ${afterSync}. Closing connection`)
|
||||
}
|
||||
this.closeConnection()
|
||||
return Promise.resolve()
|
||||
|
||||
if (afterSync === 'close') {
|
||||
console.log('SyncWorker: - Closing connection');
|
||||
this.closeConnection()
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
throw new Error(`SyncWorker.onSyncDidComplete: Unknown afterSync behavior: ${afterSync}. Closing connection`)
|
||||
}
|
||||
|
||||
onConnectionIdleUpdate() {
|
||||
|
|
Loading…
Reference in a new issue