imapflow 1.0.168 → 1.0.169
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/imap-flow.js +21 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.169](https://github.com/postalsys/imapflow/compare/v1.0.168...v1.0.169) (2024-11-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **fetc:** Treat 'Some of the requested messages no longer exist' as a success, not a failure ([565f988](https://github.com/postalsys/imapflow/commit/565f988178fc4a4d3989fe027451980f3ee0d412))
|
|
9
|
+
|
|
3
10
|
## [1.0.168](https://github.com/postalsys/imapflow/compare/v1.0.167...v1.0.168) (2024-11-07)
|
|
4
11
|
|
|
5
12
|
|
package/lib/imap-flow.js
CHANGED
|
@@ -571,9 +571,29 @@ class ImapFlow extends EventEmitter {
|
|
|
571
571
|
let err = new Error('Command failed');
|
|
572
572
|
err.response = parsed;
|
|
573
573
|
err.responseStatus = parsed.command.toUpperCase();
|
|
574
|
+
|
|
575
|
+
try {
|
|
576
|
+
err.executedCommand =
|
|
577
|
+
parsed.tag +
|
|
578
|
+
(
|
|
579
|
+
await compiler(request, {
|
|
580
|
+
isLogging: true
|
|
581
|
+
})
|
|
582
|
+
).toString();
|
|
583
|
+
} catch (err) {
|
|
584
|
+
// ignore
|
|
585
|
+
}
|
|
586
|
+
|
|
574
587
|
if (txt) {
|
|
575
588
|
err.responseText = txt;
|
|
576
589
|
|
|
590
|
+
if (err.responseStatus === 'NO' && txt.includes('Some of the requested messages no longer exist')) {
|
|
591
|
+
// Treat as successful response
|
|
592
|
+
this.log.warn({ msg: 'Partial Gmail response', cid: this.id, err });
|
|
593
|
+
await new Promise(resolve => request.resolve({ response: parsed, next: resolve }));
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
|
|
577
597
|
let throttleDelay = false;
|
|
578
598
|
|
|
579
599
|
// MS365 throttling
|
|
@@ -596,7 +616,7 @@ class ImapFlow extends EventEmitter {
|
|
|
596
616
|
delayResponse = 5 * 60 * 1000;
|
|
597
617
|
}
|
|
598
618
|
|
|
599
|
-
this.log.warn({ msg: 'Throttling detected',
|
|
619
|
+
this.log.warn({ msg: 'Throttling detected', cid: this.id, throttleDelay, delayResponse, err });
|
|
600
620
|
await new Promise(r => setTimeout(r, delayResponse));
|
|
601
621
|
}
|
|
602
622
|
}
|