-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
messageFlagsAdd deadlocks/freezes if fetch is used #110
Comments
Made a mistake while oversimplifying the repro case. await client.connect();
let lock = await client.getMailboxLock("INBOX");
try {
let processed: number[] = [];
for await (let msg of client.fetch({ seen: false }, { source: { maxLength: 2 * 1024 * 1024 } })) {
console.log(msg.seq);
processed.push(msg.seq);
break; // Important for repro
}
if (processed.length) {
await client.messageFlagsAdd(processed, ["\\Seen"]); // Freezes without any error/log
}
// ... Or with (the original code I started to track the problem down from): await client.connect();
let lock = await client.getMailboxLock("INBOX");
try {
for await (let msg of client.fetch({ seen: false }, { source: { maxLength: 2 * 1024 * 1024 } })) {
console.log(msg.seq);
client.messageFlagsAdd({ seq: msg.seq }, ["\\Seen"]); // Freezes without any error/log
}
// ... Just for future record, what is the recommended way to safely cancel the fetch loop? |
Oh, I guess I haven't documented it well enough (if at all 🤔). You can not run any IMAP command before the previous one has finished. So you can't run |
Describe the bug
messageFlagsAdd does not return if fetch was used on the client earlier
To Reproduce
If I take the seq logged to the console and use the solution without fetch:
everything works as expected.
Ubuntu 22.04, imapflow 1.0.119
The text was updated successfully, but these errors were encountered: