Author Topic: Unreliable IMAP push in Oreo  (Read 2397 times)

lobstaj

  • Newbie
  • *
  • Posts: 6
Unreliable IMAP push in Oreo
« on: April 23, 2019, 12:18:59 am »
Hi all,

for quite some time now I have noticed that I sometimes get notifications for push emails up to 10 mins too late. After some debugging, I found the following lines in Aqua mail's debug log:

2019.04.22 21:21:53.766 +0200   [NETWRK.2]   Done closing the connections
2019.04.22 21:21:53.766 +0200   [POWER.2]   >>>>> Releasing wake lock for MailConnectionManager
2019.04.22 21:21:53.766 +0200   [POWER.2]   Released wake lock flag 0x01000000, result 0x00000000
2019.04.22 21:21:53.767 +0200   LockManager   Releasing all locks
2019.04.22 21:21:53.767 +0200   LockManager   Wake lock is not held
2019.04.22 21:21:53.767 +0200   LockManager   WiFi lock is not held
2019.04.22 21:21:53.772 +0200   ImapIdleJobService   Scheduled job 1004 for 2019-04-22 21:21:58
2019.04.22 21:31:34.142 +0200   ImapIdleJobService   onStartJob: 1004, PersistableBundle[EMPTY_PARCEL]
2019.04.22 21:31:34.142 +0200   [POWER.2]   Acquired special flag 0x00000100, result 0x00000100
2019.04.22 21:31:34.142 +0200   LockManager   Acquiring the Wake lock

So Aqua mail is setting a timer to trigger in 5 seconds but Android's wake up call comes only after 10 mins. I suppose this could be related to the push email delays I'm seeing..?

Before the log output above Aqua mail had discovered a broken connection and is apparently trying to recover from that. But once the wake lock is put away, Android seems to think it can put Aqua mail to sleep for 10 mins.

Is there any way aqua mail could do whatever it is doing in the log output without releasing the wake lock in future releases?

Btw I'm using a Blackberry Keyone BBB100-2 with Android 8.1.0, kernel 3.18.71-perf-gc924168 .
(And yes, Aqua mail is excluded from battery optimizations.)

Thanks for any help already.

Regards,
J

hpg38

  • Newbie
  • *
  • Posts: 49
Re: Unreliable IMAP push in Oreo
« Reply #1 on: April 23, 2019, 08:52:27 am »
Hi, I had the same problem with a samsung under android 8.
I could not find what it was coming from and it was android that was killing Aquamail (even without optimization baterrie) because after reading an email I slipped Aquamail to close the window. Before android 8 this behavior did not kill Aqumail but since 8 it's a problem.
What happens if you come out of Aquamail without slipping it shut?

lobstaj

  • Newbie
  • *
  • Posts: 6
Re: Unreliable IMAP push in Oreo
« Reply #2 on: April 23, 2019, 12:28:02 pm »
It does not look like Aqua mail is killed in my case. I just sometimes get mails up to 10 mins late despite imap push mail being active.

It doesn't happen always, but only sometimes. Until now, I have not been able to identify factors that make the problem appear more easily (different networks etc don't seem to affect it).

Regards,
J

nadir husain

  • Full Member
  • ***
  • Posts: 107
Re: Unreliable IMAP push in Oreo
« Reply #3 on: April 23, 2019, 12:57:22 pm »
This should not happen if you have set the default  sync settings to 15 minutes  and push email active. Both have to work to get real time push notifications. I had the same problem a few months ago and Kostya helped me out with it. Sad that he has left.

lobstaj

  • Newbie
  • *
  • Posts: 6
Re: Unreliable IMAP push in Oreo
« Reply #4 on: April 23, 2019, 06:25:55 pm »
I'm suspecting Android here, this is not a config problem. Aqua mail has worked flawlessly until some time last autumn when this problem started.

As you can see from the logs, Aqua mail is setting a timer to trigger after 5 seconds when trying to recover from a lost connection. But Android only starts the timed task 10 mins later, as also visible from the logs.

I hope someone is around to check if there's a way to change Aqua mail's behaviour to not release the wake lock in that situation. That's probably the only way to have android not delay the timer.