Push: Sleeping until network is available

So the newly added Push function (thanks again for adding it back!) seems to have a tiny problem.

When I lose network connection, like when I put the phone in airplane mode overnight, the notification says “Sleeping until network is available” … which would be fine IF it woke up again once I take the phone off airplane mode lol.

But I can’t find any way to “wake it up” - I tried checking for mail manually (which it does), disabling/enabling Push … but nothing, it keeps “sleeping” like that until I reboot the device. That of course is a BIT annoying - is there no other way to wake it up again? When I take the device off airplane mode it switches to “Listening for new mail” for a split second, but that’s it.

Help please? OP7, OOS 10 rooted, latest K9 Beta.

Turning just WiFi off and back on again might help.

See [Push] Connectivity detection doesn't work properly · Issue #5366 · k9mail/k-9 · GitHub

1 Like

OK you were half right lol.

If I turn airplane mode on, then wifi back on and as a last step turn airplane mode back off THEN the notification shows “listening” again.

A bit complicated but I’m sure you’ll find a solution eventually :slight_smile:

Thanks for the tip that steered me in the right direction!

So the above solution doesn’t “really” work - while it does show “listening” I’ve received 2 emails so far (that I saw on the PC browser) and k9 didn’t notify me about them right away. One came after I opened k9 a few minutes later and the other one after I rebooted again to “fix” it.

Is Poll maybe overriding Push or something? If the network isn’t interrupted Push works great … but I need my Airplane mode at night :innocent:

Version 5.737 should be better at detecting network connectivity.

Switching networks still needs some work. If e.g. switching from a cellular network to WiFi (and the cellular network is still available) K-9 Mail will do nothing and keep the Push connections on the cellular network open. But Android will eventually terminate those connections because WiFi is now the preferred network. K-9 Mail handles that case like a generic network error and will wait 5 minutes before opening new Push connections (the notification will still say “Listening for new emails”).

In the future K-9 Mail will close the connections on the “old” network and open new Push connections (that will then use the new network).

1 Like

Thanks for the update + explanation, I’ll try the new version today. :slightly_smiling_face:

I also noticed last night that my device hasn’t been sleeping at all since the Push version - I hope that can be fixed eventually too :crossed_fingers: