imapflow 1.0.83 → 1.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ - 1.0.84 - 2022-02-17
4
+
5
+ - QRESYNC tweaks
6
+
3
7
  - 1.0.83 - 2022-02-16
4
8
 
5
9
  - QRESYNC tweaks
@@ -40,8 +40,8 @@ module.exports = async (connection, path, options) => {
40
40
  extraArgs.push([
41
41
  { type: 'ATOM', value: 'QRESYNC' },
42
42
  [
43
- { type: 'ATOM', value: options.uidValidity },
44
- { type: 'ATOM', value: options.changedSince }
43
+ { type: 'ATOM', value: options.uidValidity.toString() },
44
+ { type: 'ATOM', value: options.changedSince.toString() }
45
45
  ]
46
46
  ]);
47
47
  map.qresync = true;
@@ -156,6 +156,19 @@ module.exports = async (connection, path, options) => {
156
156
  }
157
157
  }
158
158
 
159
+ if (
160
+ map.qresync &&
161
+ // UIDVALIDITY must be the same
162
+ (options.uidValidity !== map.uidValidity ||
163
+ // HIGHESTMODSEQ response must be present
164
+ !map.highestModseq ||
165
+ // NOMODSEQ is not allowed
166
+ map.noModseq)
167
+ ) {
168
+ // QRESYNC does not apply here, so unset it
169
+ map.qresync = false;
170
+ }
171
+
159
172
  let currentMailbox = connection.mailbox;
160
173
  connection.mailbox = false;
161
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.83",
3
+ "version": "1.0.84",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {