llewelld / harbour-contrac

An implementation of the Apple/Google Exposure Notification specification for Sailfish OS.
GNU General Public License v2.0
28 stars 5 forks source link

Receiving of keys seems to freeze after a while #68

Open Matzt opened 4 years ago

Matzt commented 4 years ago

Hi there! First of all thanks a lot for the effort you put into developing a corona-app for SFOS. I very much appreciate it and it was one of the reasons I finally switched from my good old Jolla 1 to Xperia XA2. I've been using the app for roughly a week now and it seems that the app isn't able to receive any keys after a while. This happened to me twice. The first time I was able to receive roughly (I don't remember the exact number since I suffer from https://github.com/llewelld/harbour-contrac/issues/61 as well) 170 keys, the second time it was only 24. The sent keys counter keeps running though. Restarting the app doesn't seem to make a difference, rebooting the phone gets it going again. I almost exclusively use bluetooth for contrac and at least before the second freeze I didn't connect to any other device. I also don't run Amazfish. My device is Sony XA2 single sim running SFOS 3.4.0.24 and contrac 0.7.4. Dimpflmoser seems to have the same problem (https://github.com/llewelld/harbour-contrac/issues/66) but the post was too unspecific so I opened a new one to focus on this. Please let me know if I con provide any other useful Information.

Matzt commented 4 years ago

I have the impression that this is linked to putting the phone in and out of flight mode. At least I was receiving keys till I went to bed and put on flight mode yesterday and I didn't get any today yet. Could be the switch to a new day as well though. I give it a little more try.

llewelld commented 4 years ago

Thanks for your reports and for the continued investigation.

If you're switching the phone to flight mode this will deactivate Bluetooth, and it's likely this is what's causing the issue. Unfortunately right now there's no check for this in the code (see #32 and #59), so the daemon isn't aware. When Bluetooth is reactivated, the daemon doesn't therefore go through the required steps to re-establish scanning/sending.

I apologise for this; it's something that clearly needs fixing. It's at the top of my Contrac to-do list.

Matzt commented 4 years ago

Just to confirm this: Yes, it's the flight mode, I've tested it a few times by now ;-)

llewelld commented 4 years ago

Thanks for checking, and for raising it. It's definitely something that needs fixing.

dimpflmoser commented 4 years ago

Just to confirm this: Yes, it's the flight mode, I've tested it a few times by now ;-)

Would it be a workaround to deactivate 'Scan and send active' and reactivate it again?

Matzt commented 4 years ago

Yes it is. I've checked two variants:

  1. deactivate "scan and send" -> flight mode on -> flight mode off -> activate "scan and send
  2. flight mode on -> flight mode off -> deactivate "scan and send" -> activate "scan and send

Both work. Thanks for the idea :-)