Messenger randomly decides not to reconnect every 15 minutes (#25)
Andrzej Wójcik (Tigase) opened 8 years ago

For some unknown yet reason Messenger is not runned every 15 minutes and in some cases it is not runned in background even for more than an hour which leads to disconnection.

We need to investigate this issue to find root cause of it and fix it if possible.

Andrzej Wójcik (Tigase) commented 8 years ago

After analysis I came to conclusion that this issue is caused by iOS scheduling mechanism for background fetch tasks. From what I read, iOS allows background fetch task to be executed only for 30 seconds and our tasks were using 20s if at least one account was not connected. Moreover iOS uses execution time to measure power usage of background task and will reduce frequency of task being executed if task takes long time to complete.

Our 20s were close to 30s limit and every request for background fetch used 20 seconds.

I changed mechanism to reconnect as fast as possible and complete this background fetch task as soon as possible. In my typical use it reduced time from 20s to 5-6s per fetch request. This improvement should be taken into account by iOS scheduling mechanism which should allow our app to execute background fetch task more often.

Andrzej Wójcik (Tigase) commented 8 years ago

I tried to mark application as application which needs to retrieve news from time to time, but without success - application is still not being called by iOS.

Artur Hefczyc commented 8 years ago

How is it going? Can we consider it ready for public tests?

Andrzej Wójcik (Tigase) commented 8 years ago

%kobit I've tried many different possible options to ask iOS to allow our application to be waken up every X minutes. If I'm correct iOS counts every second in which application is running in background and based on that it estimates energy usage. If this usage is higher it decides to run application in background less often or even never.

To deal with that I tried to reduce time needed for connection to server and retrieval of messages and I got from 25 seconds to 6-8 seconds on average request. Unfortunately iOS still denies to call our application every X minutes and even stops calling it at all. I already sent you an email about that and we concluded that only option to deal with this for good is to use PUSH.

Artur Hefczyc commented 8 years ago

Yes, I understand and I remember our discussion about this. However, this ticket was not closed so I thought you are still working on this. In such a case I am considering the ticket to be resolved and I am closing it.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
4662
Version
Public testflight version.
Issue Votes (0)
Watchers (0)
Reference
tigase/_clients/siskin-im#25
Please wait...
Page is in error, reload to recover