AyatanaIndicators / ayatana-webmail

Webmail notifications and actions for any desktop
GNU General Public License v3.0
8 stars 4 forks source link

Delayed message checking after system resume #26

Closed IngoMeyer441 closed 2 years ago

IngoMeyer441 commented 2 years ago

After suspend, the log correctly protocols a resume event (and a network loss event), however the actual reconnection happens much later (there is a difference of about 17 minutes in my test):

2022-02-28 18:36:49,660: Ayatana Webmail: INFO: No network connection, checking in 1 minute.
2022-02-28 18:36:50,245: Ayatana Webmail: INFO: The System has resumed from sleep, reconnecting accounts.
2022-02-28 18:53:37,556: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" has been closed by the server.
2022-02-28 18:53:37,558: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" has been cleaned up.
2022-02-28 18:53:43,111: Ayatana Webmail: INFO: Checking network...
2022-02-28 18:53:43,322: Ayatana Webmail: INFO: Network connection active, connecting...
2022-02-28 18:53:43,860: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" is now connected.
2022-02-28 18:53:44,195: Ayatana Webmail: INFO: Checking network...
2022-02-28 18:53:44,417: Ayatana Webmail: INFO: Network connection active, connecting...
2022-02-28 18:53:44,585: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" has been cleaned up.
2022-02-28 18:53:44,994: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" is now connected.

If only the network connection drops, the reconnect step is performed after one minute:

2022-02-28 19:39:38,145: Ayatana Webmail: INFO: No network connection, checking in 1 minute.
2022-02-28 19:40:38,171: Ayatana Webmail: INFO: No network connection, checking in 1 minute.
2022-02-28 19:41:38,169: Ayatana Webmail: INFO: No network connection, checking in 1 minute.
2022-02-28 19:42:43,110: Ayatana Webmail: INFO: Checking network...
2022-02-28 19:42:44,609: Ayatana Webmail: INFO: Network connection active, connecting...
2022-02-28 19:59:23,369: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" has been closed by the server.
2022-02-28 19:59:23,370: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" has been cleaned up.
2022-02-28 19:59:23,801: Ayatana Webmail: INFO: "xxx@gmx.de:INBOX" is now connected.

The relevant code section looks good to me...

tari01 commented 2 years ago

I am aware of this. It seems that the delay corresponds to the IDLE timeout for a given IMAP server. Google checks in after ~10 minutes, my hosted mail server ~2 minutes.

I suspect I should look into imaplib2 for an improvement. Since this "kind of" works but is not a trivial thing to debug/improve, I'll put it on my TODO list and deal with it as soon as I have some more free time...

tari01 commented 2 years ago

Closed via https://github.com/AyatanaIndicators/ayatana-webmail/commit/4e8949fd44e4bdaf0dd8974b7581f20a5c37b0f3