snikket-im / snikket-android

Snikket Android client
https://snikket.org/app/
GNU General Public License v3.0
97 stars 18 forks source link

Snikket disconnects when receiving some messages #25

Open ike08 opened 2 years ago

ike08 commented 2 years ago

Hello, community.

The Snikket Android app disconnects when I receive a message. The sender is in my contacts, and the message is OMEMO encrypted. Here are my device details:

Google Pixel 4a (5G) Android 12 (SQ1A.220205.002) Snikket 2.10.2+pcr

Adaptive Battery is disabled. Adaptive Network is disabled. Snikket has Unrestricted Battery permission. Snikket has Unrestricted Data permission. The device is connected to WiFi with WiFi set to unmetered. The device is plugged in with 100% battery.

I tried forcing Snikket into Doze and App Standby modes to reproduce the problem, but Snikket would not enter Doze or App Standby. I assume that is because Snikket has Unrestricted Battery permission.

Force Doze

adb shell dumpsys battery unplug adb shell dumpsys deviceidle force-idle adb shell dumpsys deviceidle unforce adb shell dumpsys battery reset

Note: org.snikket.android is listed under "Whitelist user apps" when I run "adb shell dumpsys deviceidle".

Force App Standby

adb shell dumpsys battery unplug adb shell am set-inactive org.snikket.android true adb shell am set-inactive org.snikket.android false adb shell dumpsys battery reset

I also ran "adb shell dumpsys package org.snikket.android" and noticed that "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: granted=true".

Attached are several log files of the disconnects. If you need more logging, I can provide that.

logcat.zip

Help is greatly appreciated. Thank you.

mwild1 commented 2 years ago

Hi, thanks for the comprehensive report! Do you know if this issue occurs when receiving any message, or a specific message?

ike08 commented 2 years ago

No problem. Snikket disconnects for specific messages at specific times.

The message is OMEMO encrypted, and I have not seen a disconnect for unencrypted messages. The message type does not matter (text, picture, video). I don't think it matters if the sender is a saved contact or not.

I notice the disconnect when Snikket is idle for about a day. That's why I suspected Android was causing the disconnects.

After Snikket reconnects, I can send and receive messages without further disconnects.

Also, I forgot to mention that my Snikket account is on two other Android 7 devices running the Snikket app. Neither of those devices disconnects when receiving the same message.