Notifications/missed updates on iOS & mailbox.org

Delta Chat version
v1.36.4 (testflight)

Expected behavior
Notifications arrive on time (push mechanism like iOS’s mail supports with mailbox.org) or after fetching the mailbox (5-10 mins)

Actual behavior
Many of incoming messages only show up when I open up the app, and the Connectivity panel shows variation in fetch times over the average of 11-13 minutes.
The phone hasn’t entered low battery mode once.

Steps to reproduce the problem

  1. I don’t yet know.

Screen snapshots

Debug logs

Logs
iosVersion=16.4.1
notify-enabled=true

notify-remote-launch=2x since Fri, 00:00, last Fri, 10:38
notify-remote-receive=48x since 00:00, last 19 min
notify-local-wakeup=64x since 00:00, last 22:39
notify-timestamps=Sat, 22:40 Sat, 22:50 Sat, 22:58 Sat, 23:11 Sat, 23:19 Sat, 23:26 Sat, 23:29 Sat, 23:34 23:55 00:04 00:25 00:33 00:44 00:47 00:52 01:00 01:07 01:13 01:39 01:44 01:52 02:04 02:43 02:55 03:21 03:47 04:13 04:38 05:28 06:15 06:41 07:06 07:32 07:58 08:22 08:30 08:39 08:47 08:49 08:58 09:06 09:12 09:31 09:37 09:39 09:47 09:55 10:02 10:14 10:22 10:28 10:48 10:54 10:57 11:06 11:15 11:20 11:23 11:24 11:33 11:53 15:25 16:02 16:05 16:25 16:28 16:50 16:53 16:57 17:05 17:14 17:19 17:30 17:38 17:44 17:46 17:55 18:02 18:09 18:19 18:26 18:34 18:36 18:42 18:50 18:59 19:02 19:07 19:15 19:54 20:04 20:13 20:20 20:24 20:32 20:41 20:47 21:10 21:12 21:18 21:49 21:57 22:04 22:31 22:39 
notify-fetch-info2=3/0.617s/23:55 OK3/23:55 
(...)
📡/19:29 OK1/19:29 
📡/19:54 1/19:54 2/19:54 3/0.562s/19:54 OK3/19:54 
🏠/20:04 1/20:04 2/20:04 3/1.086s/20:04 OK3/20:04 
🏠/20:13 1/20:13 2/20:13 3/0.602s/20:13 OK3/20:13 
📡/20:20 1/20:20 2/20:20 3/0.562s/20:20 OK3/20:20 
🏠/20:24 1/20:24 2/20:24 3/0.809s/20:24 OK3/20:24 
🏠/20:32 1/20:32 2/20:32 3/0.715s/20:32 OK3/20:32 
🏠/20:41 1/20:41 2/20:41 3/0.577s/20:41 OK3/20:41 
📡/20:47 1/20:47 2/20:47 3/1.144s/20:47 OK3/20:47 
🏠/21:10 1/21:10 2/21:10 3/1.886s/21:10 OK3/21:10 
📡/21:12 1/21:12 2/21:12 3/0.624s/21:12 OK3/21:12 
🏠/21:18 1/21:18 2/21:18 3/0.650s/21:18 OK3/21:18 
📡/21:38 OK2/21:38 
🏠/21:49 1/21:49 2/21:49 3/0.583s/21:49 OK3/21:49 
🏠/21:57 1/21:57 2/21:57 3/0.609s/21:57 OK3/21:57 
📡/22:04 1/22:04 2/22:04 3/0.874s/22:04 OK3/22:04 
🏠/22:05 OK2/22:05 
🏠/22:31 1/22:31 2/22:31 
📡/22:31 OK2/22:31 3/2.595s/22:31 OK3/22:31 
🏠/22:39 1/22:39 2/22:39 3/2.976s/22:39 OK3/22:39 
📡/22:57 OK1/22:57 
📡/23:24 OK1/23:24
(...)
backgroundRefreshStatus=available
DEBUG=0

arch=64
authserv_id_candidates=invalidAuthservId
bcc_self=1

bot=0
configured_inbox_folder=INBOX
configured_mvbox_folder=DeltaChat
configured_sentbox_folder=Sent
configured_trash_folder=Trash

database_encrypted=false
database_version=99
debug_logging=0
delete_device_after=31536000
delete_server_after=0
delete_to_trash=<unset>
deltachat_core_version=v1.112.7

download_limit=0
e2ee_enabled=1

fetch_existing_msgs=1

folders_configured=4
imap_server_id={"name": "Dovecot"}
is_configured=1
journal_mode=wal
key_gen_type=0
last_housekeeping=1683488161
level=awesome
mdns_enabled=1
media_quality=0
messages_in_contact_requests=0
mvbox_move=1
num_cpus=6
number_of_chat_messages=808
number_of_chats=5
number_of_contacts=292
only_fetch_mvbox=0
private_key_count=1
public_key_count=7
quota_exceeding=0
scan_all_folders_debounce_secs=60
send_sync_msgs=0
sentbox_watch=0
show_emails=1
sign_unencrypted=0
socks5_enabled=0
sqlite_version=3.39.2
uptime=0h 1m 10s
-->


Is there any connection between DeltaChat and the configured mail accounts in the OS? Or is it possible to troubleshoot this on a lower level by comparing this mail provider to another?

@r10s told me once that the OK3 means the background check was successful, so 📡/23:24 OK1/23:24 was not successful for some reason?

Anyhow notifications on iOS are not too easy, because without a centralised server you can not send reliable push notifications. And you can not keep the IMAP connection in the background, because iOS freezes the app and lets it only run ever so often in the background (local wakeup is indicated by the :house_with_garden: emoji), we also increase the time it gets waken up to check for new messages via our heartbeat server (indicated by the :satellite:), that sends silent apple push notifications that wake up the bg process every 10-20 min.
Also in that regard you can not compare it to:

  • system apps like apple mail that don’t have to play by the same rules
  • provider apps like gmail that can send you push notifications directly
  • email apps that save your credentials on their server to give you push notifications and other features like spike (I think there might be more apps doing that I heard that outlook would do that too, but I’m not sure if that was real or fake news)

So there is maybe a bug in some of the fetch attempts.

I can approve this problem exist. Seen different iOS devices with different accounts. Notifications work only if

  • device is unlocked (screen on)
  • delta chat app was foreground not so long ago

Logs are similar: lots of checks ending with OK/1 or OK/2

Interesting fact – today I’ve seen that:

  • check in delta log was passed successfully
  • info in Connection tab says that it successfully woke up
  • but no notifications shown up

I just had another bunch of missed messages on my iOS client. For making a correlation with the logs, they were at 10:43, 11:05, and 13:44.
Is there a way to get more advanced logs for troubleshooting, or do anything to help to narrow this down?

Right now I’m not sure whether even my desktop client displays the notifications, because I make use of the OS Focus function, and it doesn’t always seem like I see any notification after turning it off. I’d still expect them to show.

And while the Focus is synced between devices, I thought that the notifications are generated separately across devices? Meaning that until a new message was read, if my desktop client noticed a new message, so would the iOS client. Or is that not the case?

It’s also worth mentioning that I’m using custom Focus settings - so it’s not like Do Not Disturb, which could block the notifications from being generated/displayed at all. I also have defaults for DeltaChat’s notif. settings on their own:

time logs

:house:/09:18 1/09:18 2/09:18 3/0.854s/09:18 OK3/09:18
:house:/09:27 1/09:27 2/09:27 3/1.375s/09:27 OK3/09:27
:satellite:/09:29 1/09:29 2/09:29 3/0.679s/09:29 OK3/09:29
:house:/09:41 1/09:41 2/09:41 3/15.067s/09:41 OK3/09:41
:house:/09:50 1/09:50 2/09:50 3/0.701s/09:50 OK3/09:50
:satellite:/09:55 1/09:55 2/09:55 3/0.726s/09:55 OK3/09:55
:house:/09:58 1/09:58 2/09:58 3/1.169s/09:58 OK3/09:58
:house:/10:06 1/10:06 2/10:06 3/1.086s/10:06 OK3/10:06
:house:/10:14 1/10:14 2/10:14 3/2.579s/10:14 OK3/10:14
:house:/10:35 1/10:35
:satellite:/10:35 OK2/10:35 2/10:35 3/0.874s/10:35 OK3/10:35
:house:/10:51 1/10:51
:satellite:/10:51 OK2/10:51 2/10:51 3/1.726s/10:51 OK3/10:51
:house:/11:04 1/11:04 2/11:04 3/3.743s/11:04 OK3/11:04
:house:/11:12 1/11:12 2/11:12 3/2.789s/11:12 OK3/11:12
:satellite:/11:16 1/11:16 2/11:16 3/0.998s/11:16 OK3/11:16
:house:/11:20 1/11:20 2/11:20 3/1.345s/11:20 OK3/11:20
:house:/11:28 1/11:28 2/11:28 3/0.745s/11:28 OK3/11:28
:house:/11:38 1/11:38 2/11:38 3/0.833s/11:38 OK3/11:38
:satellite:/11:42 1/11:42 2/11:42 3/0.910s/11:42 OK3/11:42
:house:/11:46 1/11:46 2/11:46 3/0.747s/11:46 OK3/11:46
:house:/11:53 1/11:53 2/11:53 3/0.767s/11:53 OK3/11:53
:house:/12:04 1/12:04 2/12:04 3/1.640s/12:04 OK3/12:04
:satellite:/12:08 1/12:08 2/12:08 3/0.800s/12:08 OK3/12:08
:house:/12:13 1/12:13 2/12:13 3/0.809s/12:13 OK3/12:13
:house:/12:23 1/12:23 2/12:23 3/1.166s/12:23 OK3/12:23
:house:/12:34 1/12:34 2/12:34 3/0.857s/12:34 OK3/12:34
:satellite:/12:36 1/12:36 2/12:36 3/0.886s/12:36 OK3/12:36
:house:/12:42 1/12:42 2/12:42 3/0.814s/12:42 OK3/12:42
:house:/12:49 1/12:49 2/12:49 3/0.913s/12:49 OK3/12:49
:house:/12:57 1/12:57 2/12:57 3/1.996s/12:57 OK3/12:57
:satellite:/13:01 1/13:01 2/13:01 3/0.803s/13:01 OK3/13:01
:house:/13:05 1/13:05 2/13:05 3/0.884s/13:05 OK3/13:05
:satellite:/13:27 1/13:27 2/13:27 3/1.067s/13:27 OK3/13:27
:house:/13:32 1/13:32 2/13:32 3/9.263s/13:32 OK3/13:32

Reporting same issue: no notifications in Delta Chat 1.36.4 under iOS 16.5. Server Dovecot, push enabled. This was tested on several iPhone and iPad devices with same results.
There are multiple support and github threads previously closed, reporting same issue. Not clear why they were closed though as same issue remains unresolved. This renders the app useless as a Chat tool. The suggested AppleMail workaround is not feasable.

I have a theory, that OS allows DeltaChat to wake up and check connection, but after that somehow it can’t fetch mail OR show notification

There is actually a problem with IDLE on the mailbox.org side.
I have recently tried to debug it with a test account and got to a conclusion that mailbox.org servers fail to send notifications and keepalives sometimes. Technical details here:
Reduce IMAP IDLE timeout and reset it on incoming "OK Still here" keepalives · Issue #5093 · deltachat/deltachat-core-rust · GitHub