Skip to content

Commit

Permalink
Fixed eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Mar 5, 2024
1 parent 1e83e64 commit 75a1ce6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/mailbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,6 @@ class Mailbox {
}

async fullSync() {
let range = '1:*';
let fields = { uid: true, flags: true, modseq: true, emailId: true, labels: true, internalDate: true };
let opts = {};

Expand All @@ -1680,17 +1679,18 @@ class Mailbox {

if (mailboxStatus.messages) {
// only fetch messages if there are some
let localRange;
let range = false;
let lastHighestUid = 0;
while ((localRange = getFetchRange(mailboxStatus.messages, localRange))) {
// process mesages in batches
while ((range = getFetchRange(mailboxStatus.messages, range))) {
let fetchCompleted = false;
let fetchRetryCount = 0;
const imapClient = this.connection.imapClient;
while (!fetchCompleted) {
try {
for await (let messageData of imapClient.fetch(localRange, fields, opts)) {
for await (let messageData of imapClient.fetch(range, fields, opts)) {
if (!messageData) {
this.logger.debug({ msg: 'Empty FETCH response', code: 'empty_fetch', query: { range: localRange, fields, opts } });
this.logger.debug({ msg: 'Empty FETCH response', code: 'empty_fetch', query: { range, fields, opts } });
responseCounters.empty++;
continue;
}
Expand All @@ -1701,7 +1701,7 @@ class Mailbox {
this.logger.debug({
msg: 'Partial FETCH response',
code: 'partial_fetch',
query: { range: localRange, fields, opts },
query: { range, fields, opts },
responseKeys: Object.keys(messageData)
});
responseCounters.partial++;
Expand All @@ -1721,7 +1721,7 @@ class Mailbox {
this.logger.debug({
msg: 'Missing INTERNALDATE',
code: 'fetch_date_missing',
query: { range: localRange, fields, opts },
query: { range, fields, opts },
responseKeys: Object.keys(messageData)
});
}
Expand Down

0 comments on commit 75a1ce6

Please sign in to comment.