imapflow 1.0.161 → 1.0.162

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.162](https://github.com/postalsys/imapflow/compare/v1.0.161...v1.0.162) (2024-05-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **idle:** Do not clear preCheck from other command ([cdf7643](https://github.com/postalsys/imapflow/commit/cdf7643952c975556e11a03ceca85f8a57fe1420))
9
+
3
10
  ## [1.0.161](https://github.com/postalsys/imapflow/compare/v1.0.160...v1.0.161) (2024-05-06)
4
11
 
5
12
 
@@ -37,7 +37,7 @@ async function runIdle(connection) {
37
37
  }
38
38
  };
39
39
 
40
- connection.preCheck = () => {
40
+ let connectionPreCheck = () => {
41
41
  let handler = new Promise((resolve, reject) => {
42
42
  preCheckWaitQueue.push({ resolve, reject });
43
43
  });
@@ -57,9 +57,11 @@ async function runIdle(connection) {
57
57
  return handler;
58
58
  };
59
59
 
60
+ connection.preCheck = connectionPreCheck;
61
+
60
62
  response = await connection.exec('IDLE', false, {
61
63
  onPlusTag: async () => {
62
- connection.log.debug({ msg: `Initiated IDLE, waiting for server input`, doneRequested });
64
+ connection.log.debug({ msg: `Initiated IDLE, waiting for server input`, lockId: connection.currentLock?.lockId, doneRequested });
63
65
  canEnd = true;
64
66
  if (doneRequested) {
65
67
  preCheck();
@@ -70,8 +72,8 @@ async function runIdle(connection) {
70
72
  }
71
73
  });
72
74
 
73
- // unset before response.next()
74
- if (typeof connection.preCheck === 'function') {
75
+ // unset before response.next() if preCheck function is not already cleared (usually is)
76
+ if (typeof connection.preCheck === 'function' && connection.preCheck === connectionPreCheck) {
75
77
  connection.log.trace({
76
78
  msg: 'Clearing pre-check function',
77
79
  lockId: connection.currentLock?.lockId,
package/lib/tools.js CHANGED
@@ -147,6 +147,8 @@ module.exports = {
147
147
  existing.path = folder.path;
148
148
  existing.subscribed = !!folder.subscribed;
149
149
  existing.listed = !!folder.listed;
150
+ existing.status = !!folder.status;
151
+
150
152
  if (folder.specialUse) {
151
153
  existing.specialUse = folder.specialUse;
152
154
  }
@@ -164,7 +166,8 @@ module.exports = {
164
166
  flags: folder.flags,
165
167
  path: folder.path,
166
168
  subscribed: !!folder.subscribed,
167
- listed: !!folder.listed
169
+ listed: !!folder.listed,
170
+ status: !!folder.status
168
171
  };
169
172
 
170
173
  if (folder.delimiter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.161",
3
+ "version": "1.0.162",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {