austrianredcross / stopp-corona-ios

iOS Source Code
https://apps.apple.com/at/app/apple-store/id1503717224
Apache License 2.0
157 stars 30 forks source link

Exposure check is not automatically performed in the background #107

Closed aschuch closed 4 years ago

aschuch commented 4 years ago

Description

This issue has been observed on two different devices, both running the latest Stopp Corona App and iOS version.

The Stopp Corona app version 2.0.4 was installed and setup last Friday on both devices. After the initial setup and granting the Exposure Logging permission, the app was sent to the background and not opened again for a couple of days.

Fast forward a few days: After 1 week of usage, navigating to "Settings > Privacy > Health > COVID-19 Exposure Logging > Exposure Checks" showed 0 Exposure Checks in the last 14 days on both devices. Only after re-opening the Stopp Corona app, the first Exposure Check appeared in Settings. Now (after re-opening the app), I can observe an automatic exposure check performed in the background every ~2 hours.

It seems like the app does not automatically perform the exposure check after the initial setup and does not perform any subsequent automatic exposure checks in the background. The app needs to be opened again after a few days, to enable the desired automatic background exposure check.

Reproduction steps

  1. Download and install Stopp Corona 2.0.4 on a new iOS device
  2. Open the app, grant the Exposure Logging permission
  3. Send the app to the background
  4. Wait a few days without opening the app
  5. Observe, that "Settings > Privacy > Health > COVID-19 Exposure Logging > Exposure Checks" shows 0 Exposure Checks in the last 14 days

Additional information Devices: iPhone XR (iOS 13.5.1), iPhone Xs (iOS 13.5.1) Stopp Corona 2.0.4

After 1 week of usage After re-opening the app

What did you expect

The Stopp Corona app should automatically perform regular exposure checks in the background, without the need to open the app at any point after the initial setup.

chgerwig commented 4 years ago

I have a similar experience. Running the app on iOS and Android both phones are always with me. Android version found 7 contacts in 2 days and iOS zero. It should at least find his 'neighbour' Android device.

aschuch commented 4 years ago

The issue is not related to the collection of keys from other devices, this seems to work. In my case, the exposure check was never automatically performed in the background until the app was manually opened again. As soon as the exposure check runs, it reports >1000 found keys.

bastianh commented 4 years ago

We are currently investigating why the background task is not always triggered correctly and we are in contact with apple regarding this issue. The 2.0.4 version was released during this week, so I guess you had a previous version installed last friday.

bigb2000 commented 4 years ago

Dear developers,

i observed the same issue that @aschuch described in the original post on my device, running iOS 13.5.1 on an iPhone SE (2020). Same with 2.0.4: Startet Stopp Corona manually on Saturday 12:07. Then 5 exposure check were made in background (approx. every 2 hours; 22:56 the last). Yesterday nothing. Today started Stopp Corona manually and after a few seconds "Exposure Checks" list shows a new entry.

seehma commented 4 years ago

Same issue here. I have some exposure checks, but sometimes when I'm with colleagues in the same room I have no key pair exchanged...

The issue is not related to the collection of keys from other devices, this seems to work. In my case, the exposure check was never automatically performed in the background until the app was manually opened again. As soon as the exposure check runs, it reports >1000 found keys.

Im not sure whats the correct meaning of the field "Anzahl der bereitgestellten Schlüssel" because I also have numbers between 1000 and 1100 there but I never ever had so many contacts (or exchanged keys). The next thing which is weird is, that the number is not continuously incrementing from check to check.

bigb2000 commented 4 years ago

Same issue here. I have some exposure checks, but sometimes when I'm with colleagues in the same room I have no key pair exchanged...

The issue is not related to the collection of keys from other devices, this seems to work. In my case, the exposure check was never automatically performed in the background until the app was manually opened again. As soon as the exposure check runs, it reports >1000 found keys. ...

Im not sure whats the correct meaning of the field "Anzahl der bereitgestellten Schlüssel" because I also have numbers between 1000 and 1100 there but I never ever had so many contacts (or exchanged keys). The next thing which is weird is, that the number is not continuously incrementing from check to check.

As far i understood is that the value "Anzahl der bereitgestellten Schlüssel" means the downloaded keys (plus some dummies) from the application servers of possible COVID-19 diseased people. I have some similar numbers on my phone. The value "Anzahl der abgeglichenen Schlüssel" are the number of keys stored on your device matching the downloaded keys. If this number is greater than 0 you might have contact with someone COVID-19 positive.

bastianh commented 4 years ago

I think there is a fixed number of random keys added to the reports for privacy reasons. Depending on how many keys were uploaded or revoked the last days the number will go up and down .. Depending on your status the app will only download and check the keys for the last 7 or 14 days.

seehma commented 4 years ago

So I cant see that my phone has exchanged keys with another phone anywhere. Neither in the StoppCorona-App or in the Privacy-Health-Covid19 Exposure Settings? The Log I see in the Settings is only the check with the central server where all the positive results are stored?

bigb2000 commented 4 years ago

So I cant see that my phone has exchanged keys with another phone anywhere. Neither in the StoppCorona-App or in the Privacy-Health-Covid19 Exposure Settings?

True

The Log I see in the Settings is only the check with the central server where all the positive results are stored?

Yes

seehma commented 4 years ago

Is there any chance for the developer to get the information how many keys are exchanged by the app or is it because of privacy held secretly? Is it better to say that the keys are exchanged by the iOS&Android Service/BT-Interface and the app only controls all this stuff (sending frequency, renewal of keys and so on) with the new API.

bastianh commented 4 years ago

No.. the api is very restricted. There is no way for the app to find out how many people you meet or stuff like that. Only when the key of the other person is downloaded over the api the the app can get some details about the contacts that took place with this person. The api is very restricted, it can be only called 15 times per day for example and the phone will always inform you with a push message when the app checks details about those possible exposures.

bastianh commented 4 years ago

2.0.5 has been reviewed by apple and should show up in the appstore soon.

aschuch commented 4 years ago

Thanks, the update seems to resolve the issue. The app had to be opened one more time after installing 2.0.5. Now, regular exposure checks are performed in the background automatically as expected.

mpwg commented 4 years ago

It still doesnt work reliable. I have 2.0.5, iOS 13.5.1.

Today is 14.07.2020, the last check was performed on 11.07.2020 (see screenshot) When I open the app, i get a new entry

Bildschirmfoto 2020-07-14 um 15 16 10

seehma commented 4 years ago

Same here, my last check was on the 9th of July, since then no check. Today i started the App now i have two checks today

bastianh commented 4 years ago

when did you update to 2.0.5 and did you open the app after the update?

mpwg commented 4 years ago

Yes, i opened the App (at least i think so)

Edit: i Updated the App on 09.07.2020 (According to the Update-page on the app store)

seehma commented 4 years ago

I updated immediately after your post here, after the update i think i opened the App. Since then i didnt open it again till today.

bigb2000 commented 4 years ago

Same for me. Unreliable in background. Updated to latest version on 9th of July. Started the App once. After that exposure checks were done in background until 12 th of July 07:31. Started again the app yesterday (the 13 th) and immediately afterwards an exposure check was made. Periodically every approx. 2 hours (with pause during the night; maybe because i'm going to flight mode) until today. Not a bis issue for me as i can have a look at that...

mpwg commented 4 years ago

Just checked on an other iPhone: same behavior.

mitsuhiko commented 4 years ago

This issue is still occurring.

aschuch commented 4 years ago

The issue is now back on my devices as well. I did not open the app for quite a while and the last exposure check was performed on July 14th (over one week ago).

mpwg commented 4 years ago

I've installed iOS 13.6 on 15.7. opened stop corona once after that and never again to see what's happening.

It looks like it is performing the checks every day now. Maybe the iOS Update fixed some things?

But the last 3 days look somewhat strange.

image

09.08.2020 Update: still works as it should. Multiple checks every day on all my iPhones with iOS 13.6 Maybe the bug can be closed again?

aschuch commented 4 years ago

@mitsuhiko @bastianh Are you still investigating this issue? What is the current status?

mitsuhiko commented 4 years ago

Unfortunately I haven’t been able to investigate this with my limited abilities to test this. I’m generally not sure how to do or review meaningful changes as there is no good system in place to ensure it does not regress in other ways.

bastianh commented 4 years ago

I'm currently testing a version with small adjustments running on iOS 13.7, running the exposure checks fine 5-6 times a day without opening the app for over a week, so it looks like the problem is solved. The version is currently going though internal QA. It's important to update devices to 13.7. Many bugfixes and improvements were done to exposure framework.

aschuch commented 4 years ago

Exposure checks work with app version 2.0.7 and iOS 14.1 on my device now.

bastianh commented 4 years ago

I'm closing this bug for now .. if you experience any problems please let us know.