mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 18:44:01 +08:00
fix(sync): Issue with CONDSTORE args not passed to fetch
This commit is contained in:
parent
82f505b659
commit
ece519553f
3 changed files with 9 additions and 9 deletions
|
@ -124,10 +124,10 @@ class IMAPBox {
|
|||
* @return {Promise} that resolves to a map of uid -> attributes for every
|
||||
* message in the range
|
||||
*/
|
||||
fetchUIDAttributes(range) {
|
||||
fetchUIDAttributes(range, fetchOptions = {}) {
|
||||
return this._conn.createConnectionPromise((resolve, reject) => {
|
||||
const attributesByUID = {};
|
||||
const f = this._conn._imap.fetch(range, {});
|
||||
const f = this._conn._imap.fetch(range, fetchOptions);
|
||||
f.on('message', (msg) => {
|
||||
msg.on('attributes', (attrs) => {
|
||||
attributesByUID[attrs.uid] = attrs;
|
||||
|
|
|
@ -18,7 +18,7 @@ class FetchMessagesInFolder {
|
|||
this._db = null
|
||||
this._category = category;
|
||||
this._options = options;
|
||||
this._logger = logger;
|
||||
this._logger = logger.child({category_name: this._category.name});
|
||||
if (!this._logger) {
|
||||
throw new Error("FetchMessagesInFolder requires a logger")
|
||||
}
|
||||
|
@ -124,14 +124,14 @@ class FetchMessagesInFolder {
|
|||
.filter(msg => !remoteUIDAttributes[msg.folderImapUID])
|
||||
.map(msg => msg.folderImapUID)
|
||||
|
||||
this._logger.info({
|
||||
removed_messages: removedUIDs.length,
|
||||
}, `FetchMessagesInFolder: found messages no longer in the folder`)
|
||||
|
||||
if (removedUIDs.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._logger.info({
|
||||
removed_messages: removedUIDs.length,
|
||||
}, `FetchMessagesInFolder: found messages no longer in the folder`)
|
||||
|
||||
await this._db.sequelize.transaction((transaction) =>
|
||||
Message.update({
|
||||
folderImapUID: null,
|
||||
|
@ -248,7 +248,7 @@ class FetchMessagesInFolder {
|
|||
}
|
||||
|
||||
async _openMailboxAndEnsureValidity() {
|
||||
const box = this._imap.openBox(this._category.name);
|
||||
const box = await this._imap.openBox(this._category.name);
|
||||
|
||||
if (box.persistentUIDs === false) {
|
||||
throw new Error("Mailbox does not support persistentUIDs.");
|
||||
|
|
|
@ -216,7 +216,7 @@ class SyncWorker {
|
|||
|
||||
const target = this._lastSyncTime + (moreToSync ? 1 : intervals.active);
|
||||
|
||||
this._logger.info(`SyncWorker: Scheduling next sync iteration for ${target - Date.now()}ms}`)
|
||||
this._logger.info(`SyncWorker: Scheduling next sync iteration for ${target - Date.now()}ms`)
|
||||
|
||||
this._syncTimer = setTimeout(() => {
|
||||
this.syncNow({reason: 'Scheduled'});
|
||||
|
|
Loading…
Reference in a new issue