{"action":"closed","issue":{"url":"https://api.github.com/repos/siacs/Conversations/issues/1910","repository_url":"https://api.github.com/repos/siacs/Conversations","labels_url":"https://api.github.com/repos/siacs/Conversations/issues/1910/labels{/name}","comments_url":"https://api.github.com/repos/siacs/Conversations/issues/1910/comments","events_url":"https://api.github.com/repos/siacs/Conversations/issues/1910/events","html_url":"https://github.com/siacs/Conversations/issues/1910","id":159857686,"number":1910,"title":"Feature: disable \"Battery optimizations enabled\" when it's unnecessary","user":{"login":"kousu","id":987487,"avatar_url":"https://avatars.githubusercontent.com/u/987487?v=3","gravatar_id":"","url":"https://api.github.com/users/kousu","html_url":"https://github.com/kousu","followers_url":"https://api.github.com/users/kousu/followers","following_url":"https://api.github.com/users/kousu/following{/other_user}","gists_url":"https://api.github.com/users/kousu/gists{/gist_id}","starred_url":"https://api.github.com/users/kousu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kousu/subscriptions","organizations_url":"https://api.github.com/users/kousu/orgs","repos_url":"https://api.github.com/users/kousu/repos","events_url":"https://api.github.com/users/kousu/events{/privacy}","received_events_url":"https://api.github.com/users/kousu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-13T00:54:11Z","updated_at":"2016-06-13T07:08:06Z","closed_at":"2016-06-13T07:08:06Z","body":"\r\n#### General information\r\n\r\n* **Version:** eg 1.12.9\r\n* **Device:** Moto E\r\n* **Android Version:** Android 6.0 Cyanogenmod\r\n* **Server name:** self hosted\r\n* **Server software:** 0.9.7-2+deb8u3\r\n* **Conversations source:** F-Droid\r\n\r\n#### Steps to reproduce\r\n\r\n1. Add any account on a fresh install\r\n2. Go to account details\r\n3. See \"Battery optimizations enabled\" with the warning about losing messages\r\n\r\nThis is strange to me because you [advertise battery friendly operation](https://conversations.im/#optimizations claims). I recommended Conversations to a friend but lost him because it ate too much of his battery, and I suspect it was because of this; I ran into it myself after an update to Android 6: over the next few days I watched as Conversations would eat 20% of my total battery. I don't remember it doing that before, which I assume is because Android 4 would not allow Conversations to ask for that.\r\n\r\nMy understanding is that \"battery optimizations\" means \"killing inactive connections\" or maybe \"killing connections for apps that haven't been opened in a while\", and you want to disable this to make sure you don't lose your TCP connection[*]. But if XEP 198 solves that, disable them? I tried re-enabling optimizations and found that Conversations still got messages from all the MUCs I'm in and went back to using only like 4% of my power. Today I am enabling XEP 198 for just in case, and it occurred to me that this could be better.\r\n\r\nInstead of a scary \"Android might lead to message loss\" message, I would like to see this UI reworked softer. It should only show this message for accounts that don't have XEP 198 and/or 352 available, and for those it should explain \"Your server does not have the optimizations enabled, so to prevent message loss consider disabling Android's battery optimizations.\"\r\n\r\n[*] My understanding is lost messages happen in XMPP when a device rapidly switches networks: the server hasn't received `<presence type='unavailable'>` or noticed a dropped TCP connection, so it sends stanzas down the pipe and forgets them, before knowing if they got there or not.  I guess the kernel TCP buffers will try to resend the missing pieces until the kernel gives up on the TCP connection entirely and if you reconnect from the same address shortly enough they will arrive, but if you reconnect at a new IP address, as happens in switching cellular to wifi they are lost."}}
{"actor":{"display_login":"iNPUTmice"}}