-
Notifications
You must be signed in to change notification settings - Fork 96
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
Hang/stall of (new) message receipts ("Updating..." forever, caused by FCM Push?) #6532
Comments
Could be a duplicate of #6477 Regarding background fetch in response to FCM push, in the log there was only one background fetch for 4 accounts and it finished:
|
I notice similar things happen on my wife phone while mine is almost always just fine. I suspect it is a problem with how imap code works. Example:
Interestingly this is not happening with FairEmail which also relies of IMAP IDLE. So maybe you guys could take a peek at what Marcel is doing in his imap code ? This is just a theory but in my case I can reproduce it every time I try. EDIT: This is a quote from FairEmail FAQ - maybe it will be useful for you:
In case of my imap server imap_idle_notify_interval is set to 29 minutes. |
@as400l Thank you for your detailed report. Years ago I discovered exactly the same issue in regard to WLAN connections and Delta Chat on my former phone (Fairphone FP2 and Android 11). My current configuration uses mobile data only, so the problem no longer occurs to me anymore. But I noticed an important thing: In Android developer functions (tap build number seven times to enable them), there is a function named "Mobile data always active" enabled by default. After I disabled this function, the issue you described had been gone. So I believe that Delta Chat does not "listen" to such OS network updates, but holds on to the (inactive) mobile data gateway idling in the background when this function is enabled. So, if you were able to test whether or not this function makes a difference, we would be glad to read of your results. Many thanks in advance! :) |
@gerryfrancis - thanks for confirmation. I will try to find out tomorrow. Good thing is that I'm not crazy :) In the meantime I contacted Marcel of FairEmail. This is his reply to my questions about IMAP IDLE:
|
@gerryfrancis I tested today. BTW - on GrapheneOS the option is enabled by default. |
@as400l I experienced the issue while "Mobile data always active" had been on, but instead messages were received in time while connected to WLAN and having that function off. Maybe you need to switch off the setting, then reboot the phone, then launch Delta Chat and see whether it makes a difference or not. |
@gerryfrancis I tested this on that mentioned earlier Samsung device. It was actually off by default. |
Delta Chat does not use NOOP, but tries to refresh IDLE every 5 minutes by terminating it and starting again. This does not work as expected on Android though because of the bug rust-lang/rust#71860 and the timeout possibly taking much longer than 5 minutes of wall clock time if the app is in background. I don't think the issue discussed in the last few posts (NAT forgetting about the connection because of no keepalives or too long keepalive interval) is related to the original issue. In case of NAT forgetting the connection Delta Chat recovers after 1 minute when you get it out of the background. |
Maybe implementing unifiedpush would be a viable resolution to these notification problems ? |
@as400l AFAIK, the server must support push notifications, too, and there are just a few email providers who do that. I think it would not solve the core issue for users who cannot use FCM Push/UnifiedPush. |
@gerryfrancis I think I found solution. I lowered "imap_idle_notify_interval" to 2 minutes and it works on both phones which were sleeping entire night. And I changed multiple power saving settings on Samsung. What a crap btw. |
@as400l Thank you for your feedback. Please describe which power saving settings you changed, so i can check them on my Google Pixel 8 and do some tests here. Thank you in advance. |
@gerryfrancis Just so we understand each other correctly. I have Google Pixel 7. My wife phone is Samsung. And I changed her phone settings according to ----> https://dontkillmyapp.com/samsung (for Android 13). This howto is useless for Pixel phones as Samsung adds multiple battery saving features not present in AOSP Android (my Pixel is running GrapheneOS). But anyways until I changed Dovecot setting (imap_idle_notify_interval) it wasn't working properly on both phones. Even though power saving settings were changed. What I have changed on my Pixel:
|
@as400l Thank you for clarifying.
This is no power saving setting and has no immediate effect at the time of enabling. It just archives apps that have not been used for a certain period of time (days/weeks/months). Eventually granted rights are withdrawn, too, as soon as an app has been archived.
Aren't we talking about WLAN connections?
This is mandatory to keep background connections alive in Delta Chat. |
@gerryfrancis I basically included everything I personally changed. |
I also just experienced something similar on 1.52.1 F-Droid on my testrun.org account (not Chatmail). Android 15, with no Google Play services. I have enabled "Force Background Connection". No messages get received, but sending works. It constantly shows "Updating...". "Connectivity" says "Connected". It stayed like this for a few hours (from 2 to 16). |
@WofWca Releases from the F-Droid store do not support FCM Push, so your issue might be a different one, but I am not absolutely sure. |
Moved to the core repository by appointment of @adbenitez . :) |
Let's close as duplicate of #6477 until someone produces more logs with a new version so we can figure out where IMAP loop got stuck. Most likely it's the same issue. IDLE not resetting every 5 minutes because of rust-lang/rust#71860 and tokio-rs/tokio#3185 is another issue and offtopic for this one. Interesting that it can be worked around by reducing |
I also created #6533 for keepalive frequency issue. |
Android version:
Android 15.
Device:
Google Pixel 8.
Delta Chat version:
1.50.5.
Expected behavior:
(New) messages are received as they are looked up/fetched from the server.
Actual behavior:
(New) messages are not received, the app hangs/stalls at "Updating...". When this happens, the app must be terminated and relaunched in order to receive messages again.
Steps to reproduce the problem:
Unknown.
Screenshots:
N/A.
Logs:
deltachat-log-20250114-160450_2.txt
Remarks:
When this happens, a line like this has been recorded in the log:
01-14 16:04:22.995 29692 29835 🟠 chat.delta: AIBinder_linkToDeath is being called with a non-null cookie and no onUnlink callback set. This might not be intended. AIBinder_DeathRecipient_setOnUnlinked should be called first.
The text was updated successfully, but these errors were encountered: