imapflow 1.0.175 → 1.0.176
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 +7 -0
- package/lib/commands/idle.js +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.176](https://github.com/postalsys/imapflow/compare/v1.0.175...v1.0.176) (2025-01-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **idle:** Treat preCheck as async function ([346bb43](https://github.com/postalsys/imapflow/commit/346bb430e2ddeeb877b5778f9f1bdfd97a83ee4c))
|
|
9
|
+
|
|
3
10
|
## [1.0.175](https://github.com/postalsys/imapflow/compare/v1.0.174...v1.0.175) (2025-01-15)
|
|
4
11
|
|
|
5
12
|
|
package/lib/commands/idle.js
CHANGED
|
@@ -14,7 +14,7 @@ async function runIdle(connection) {
|
|
|
14
14
|
let doneSent = false;
|
|
15
15
|
let canEnd = false;
|
|
16
16
|
|
|
17
|
-
let preCheck = () => {
|
|
17
|
+
let preCheck = async () => {
|
|
18
18
|
doneRequested = true;
|
|
19
19
|
if (canEnd && !doneSent) {
|
|
20
20
|
connection.log.debug({
|
|
@@ -52,7 +52,7 @@ async function runIdle(connection) {
|
|
|
52
52
|
doneSent
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
preCheck();
|
|
55
|
+
preCheck().catch(err => connection.log.warn({ err, cid: connection.id }));
|
|
56
56
|
|
|
57
57
|
return handler;
|
|
58
58
|
};
|
|
@@ -64,7 +64,11 @@ async function runIdle(connection) {
|
|
|
64
64
|
connection.log.debug({ msg: `Initiated IDLE, waiting for server input`, lockId: connection.currentLock?.lockId, doneRequested });
|
|
65
65
|
canEnd = true;
|
|
66
66
|
if (doneRequested) {
|
|
67
|
-
|
|
67
|
+
try {
|
|
68
|
+
await preCheck();
|
|
69
|
+
} catch (err) {
|
|
70
|
+
connection.log.warn({ err, cid: connection.id });
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
},
|
|
70
74
|
onSend: () => {
|