-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix: do not miss new messages while expunging the folder #5669
Conversation
cdf8e30
to
3f218b0
Compare
3f218b0
to
003d178
Compare
Finally non-flaky CI, but need to think of a proper fix now. |
This should fix flaky `test_verified_group_vs_delete_server_after`.
01611be
to
e598748
Compare
On Windows tests failed once with "Backup provider did not start in time" message, but this is likely just because timeout is 10 seconds and GitHub Actions seem to sometimes pause/stop VMs: |
@@ -92,6 +96,9 @@ impl Session { | |||
session.as_mut().set_read_timeout(Some(IMAP_TIMEOUT)); | |||
self.inner = session; | |||
|
|||
// Fetch mail once we exit IDLE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do i correctly understand that this is just in case and not related to the fix itself? Can it be done under if self.server_sent_unsolicited_exists(context)?
if so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not just in case, without this line tests will fail.
If IDLE exits because of NewData, we want session.new_mail
be true next time fetch_new_messages
is called. Previously fetch_new_messages
called session.select_with_uidvalidity
and used its return value to decide if it should try to fetch messages. session.select_with_uidvalidity
returned true if the folder was already selected, so most of the time fetch happened.
In cases other than NewData
it may be not necessary, but other cases are rare so better try fetching. E.g. in case of manual interrupt it seems better to fetch, because who knows what kind of broken IMAP servers are there, closing and reopening the app should not rely on correctly working IDLE to try fetching messages.
I think IDLE response does not get into unsolicited channel, so checking for unsolicited EXISTS is not enough. Unsolicited EXISTS is an EXISTS response that you get e.g. when issuing a FETCH
or STORE
command.
This should fix flaky
test_verified_group_vs_delete_server_after
.Fix #5201