corona-warn-app / cwa-app-ios

Native iOS app using the exposure notification framework from Apple. The CWA development ends on May 31, 2023. You still can warn other users until April 30, 2023. More information:
https://coronawarn.app/en/faq/#ramp_down
Apache License 2.0
1.68k stars 285 forks source link

Background Actualization of IDs only when App is started #740

Closed gigiCom closed 4 years ago

gigiCom commented 4 years ago

Background Actualization of IDs only when App is started.zip

Avoid duplicates

Describe the bug

The actualization of the risk, i.e. of the IDs that are present on the server, does only happen if the app is started and not if the app is closed.

This contradicts the published statement that the app does actualize in background.

This behavior means that persons who have installed the app, closed it and don't open it anymore, will never get informed about potential critical Corona contacts in the past, because the system does not download the risky IDs at all.

Only if the app gets started or if the app remains started (in the background), the IDs get downloaded. But not if the app is closed.

I have the background actualization switched on (see attachment), and I attached a video that shows (in slow motion) that I have actualized my IDs yesterday at 8:59. Today, I start the app at 10:40 and see immediately that the time stamp in the green risk panel switches from 8:59 to 10:40. I reproduced that behavior on my iOS phone 2 times in the last days and also 1 time on another iOS phone. On Android phones, this all seems not to occur.

If one lets the app open in background, this behavior does not occur, the IDs get updated in the background as expected, e.g. every day at 8:59.

Expected behaviour

The app should do the ID update in the background even if the app is closed, this is the expected and communicated behavior to the public, and it is the behavior on Android phones.

Steps to reproduce the issue

see attached video.

If the app remains started (even in the background), and you bring it to the foreground the day after at 10:40, you see the time stamp shows today, 8:59.

Technical details


Internal Tracking ID: EXPOSUREAPP-1832

marcelkliemannel commented 4 years ago

I am experiencing the same problem with iPhone 7 and iOS 13.5.1 and I checked that the app is allowed to run in background.

When I started the app yesterday at around 6 o'clock I got the message "Updated: Yesterday, 06:50". When I started it again at 7:20, the message changed to "Updated: Today, 7:20". Today the same: I started the app around 6 o'clock and I got the message "Updated: Yesterday 7:20". I started it at 10:08 again and then the message jumped to "Updated: Today: 10:08". This indicates that no automatic update has been performed.

This behavior also means that the check interval, which was supposed to be 24 hours, became longer and longer every day. If I don't open the app tomorrow at 10:08 but at 12:00, it can only be updated the following day after 12:00...

danielburkard commented 4 years ago

The problem is that the developer decided very early against pushing updates through silent notifications. Running background tasks on iOS is very limited. Especially if the user doesn’t use the app regularly.

Gorilla89 commented 4 years ago

Same problem here (iOS 13.5.1) with new iPhone SE. It seems the risk is only updated once the app is started (which will happen only rarely...) I think this has to be fixed urgently as the whole concept doesn‘t work when there is no background update. On my an iPhone X it’s even worse: risk calculation is active, however not possible as it couldn‘t be updated for more than 24 hours according to the message on the screen

ay-kay commented 4 years ago

Since yesterday the first diagnosis keys are available now, however, my app has not updated since yesterday morning and my exposure log has not been checked. So this is a whole day that I was not warned of possible exposures and could possibly have infected many more people. After the release of new keys the checks should be triggered as soon as possible, which is not possible with the fetch background mode that gives an app execution time at irregular intervals only, and only very rarely, if the app is not actively used.

Either Apple can make an exception for Corona Warn Apps and schedule the execution more often, or Silent Push Notifications would be appropriate. This would allow the checks to be carried out promptly, which I urgently consider necessary here.

As an interim solution, is there a way to trigger the exposure check each time the app is started, or at least manually?

IMG_8821 IMG_8820

kamil-gwozdz commented 4 years ago

Since yesterday the first diagnosis keys are available now, however, my app has not updated since yesterday morning and my exposure log has not been checked. So this is a whole day that I was not warned of possible exposures and could possibly have infected many more people. After the release of new keys the checks should be triggered as soon as possible, which is not possible with the fetch background mode that gives an app execution time at irregular intervals only, and only very rarely, if the app is not actively used.

Either Apple can make an exception for Corona Warn Apps and schedule the execution more often, or Silent Push Notifications would be appropriate. This would allow the checks to be carried out promptly, which I urgently consider necessary here.

As an interim solution, is there a way to trigger the exposure check each time the app is started, or at least manually?

IMG_8821 IMG_8820

Hi, I’m having the same issue.

I installed the app 8 days ago and and my exposure log wasn’t checked yet. 7086AA0C-7105-4B86-B1F3-D15885665D20 D4443E8C-07DC-4DCE-A2B2-5D5B0FB5A7F8

JThoennes commented 4 years ago

In addition, I tend to run my iPhone 11 Pro with iOS 13.5.1 mostly in power save mode. Therefore, I would guess that the app does not update in the background. Is that true? Could that be possibly be changed?

BastianZim commented 4 years ago

Is that true?

I checked it on my iPhone with no power-saving and the result is the same, so I don' think that it is related to that.

crumbach commented 4 years ago

Same problem here on a Pixel 4XL, Android 10. If app is opened after more than 24 hours since last opening, it first shows an "unknown risk status. You are not using the app long enough yet.". Then and only then, the update is performed and all information is correct again. I was able to reproduce on a second device (OnePlus 3) and attach a video thereof. unknownRisk.zip

Note: this only occurs since the last update of the app three days ago.

sysfyg commented 4 years ago

Same problem here on a Pixel 4XL, Android 10. If app is opened after more than 24 hours since last opening, it first shows an "unknown risk status. You are not using the app long enough yet.". Then and only then, the update is performed and all information is correct again. I was able to reproduce on a second device (OnePlus 3) and attach a video thereof. unknownRisk.zip

Note: this only occurs since the last update of the app three days ago.

Could it be related to CWA-server release 3 days ago?

ferdinand commented 4 years ago

Since I open the app regularly after 24 hours, I can’t tell if I‘m affected as well. But when I told somebody on Twitter that the Background App Refresh doesn’t work with activated Low Power Mode, I received several replies from people, who never use the Low Power Mode, complaining as well about the app not doing the check automatically.

I‘m aware that at some point iOS should run the background task and they‘re probably just not patient enough, but besides the fact that users should receive the warning as soon as possible it’s also an user experience issue if users don’t trust in the app working automatically.

PalminX commented 4 years ago

I can confirm this behaviour (background updates of exposure check not running unless the app is opened) on iOS 13.5.1.

This is unrelated to things like Low Power Mode. I am seeing this for other apps which use BGProcessingTaskRequest, even though the requests are scheduled, it is not guaranteed that iOS will honor them.

danielburkard commented 4 years ago

This years WWDC included some related session: Background execution demystified

mss1010 commented 4 years ago

I can also confirm this issue on an iPhone XS with iOS 13.5.1 On this screenshot from today you see, that the IDs were last downloaded the day before yesterday. So, yesterday, nothing was downloaded at all. Only when I started the app manually, it downloaded the IDs.

I had all background related settings active and also had no battery saving mode active. To me this seems like a really serious issue, because this will mean for most users who just install the app, and don´t open it again, the app will never download any IDs. So, the whole concept does not work at all!

Might be that this is due to the limitations by Apple related to background tasks, but I think this should be analyzed with a high priority. My guess is, that the whole concept does not work at all for the majority of users.

@tkowark Can someone from the developers please comment?

IMG_1110

tens0rfl0w commented 4 years ago

Can confirm this behavior after several days of testing. Only worked once on the first day a data set was published. No visible log errors regarding background execution or time rule breaking.

13.5.0, iPX, no power saving mode activated

Kljcjbjj commented 4 years ago

I have the same Problem: only by starting the app the keys are downloaded and checked. They are not updated in the background.

I tried it with activated and deactivated power saving mode on several devices:

iPhone 6S iPhone 7

iOS 13.5.1

PalminX commented 4 years ago

I don't consider myself an expert on this, but I have contributed to a project which also used BGProcessingTask, and looking at ENA/ENA/Source/Models/Task%20Scheduling/ENATaskScheduler.swift, I have some remarks. Hopefully, some devs could look into this:

As I said, I am not an expert, and I can't be sure that this is relevant, this is just what I noticed as odd

pkreissel commented 4 years ago

Ok I checked this Bug with several phones. Some people hadn't opened the app since they installed it on day 1, and they had NO "Kontaktüberprüfung" AT ALL in their logs. It only showed the current keys after they opened the App. This is really really bad.

JThoennes commented 4 years ago
    I  actually wonder whether the developers use this app on their own iPhones - eat your own dog food. If you watch carefully this could have been noted and reported shortly after launch. Still waiting for any official feedback - or did I miss anything? Time for a patch release...

On Mon, Jun 29, 2020 at 8:42 PM +0200, "Philip Kreißel" notifications@github.com wrote:

Ok I checked this Bug with several phones. Some people hadn't opened the app since they installed it on day 1, and they had NO "Kontaktüberprüfung" AT ALL in their logs. It only showed the current keys after they opened the App. This is really really bad.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

mss1010 commented 4 years ago

If the developers will not react and comment within the next 2 days, I guess we should inform media sites that the app is basically disfunctional.

inf2381 commented 4 years ago

If the developers will not react and comment within the next 2 days, I guess we should inform media sites that the app is basically disfunctional.

You are of course free to inform whoever you see fit about this issue. But keep in mind that the app is only facing issues in a small set of edge-cases, we are already investigating this issue (as visible by the assigned status) and we have other issues with higher priority (e.g., the unexpected error codes from the system which we have to investigate together with Apple).

haosap commented 4 years ago

Since yesterday the first diagnosis keys are available now, however, my app has not updated since yesterday morning and my exposure log has not been checked. So this is a whole day that I was not warned of possible exposures and could possibly have infected many more people. After the release of new keys the checks should be triggered as soon as possible, which is not possible with the fetch background mode that gives an app execution time at irregular intervals only, and only very rarely, if the app is not actively used. Either Apple can make an exception for Corona Warn Apps and schedule the execution more often, or Silent Push Notifications would be appropriate. This would allow the checks to be carried out promptly, which I urgently consider necessary here. As an interim solution, is there a way to trigger the exposure check each time the app is started, or at least manually? IMG_8821 IMG_8820

Hi, I’m having the same issue.

I installed the app 8 days ago and and my exposure log wasn’t checked yet. 7086AA0C-7105-4B86-B1F3-D15885665D20 D4443E8C-07DC-4DCE-A2B2-5D5B0FB5A7F8

Hi @kamil98 , Thanks for reporting this bug. I guess your situation might be related to: https://github.com/corona-warn-app/cwa-app-ios/issues/759 and https://github.com/corona-warn-app/cwa-app-ios/issues/766. The background task got scheduled, but due to the bugs from #759 or #766 , the detection cannot be executed correctly, therefore, there's no detection logs appear in the system setting. My suggestion is, to switch to manual mode, and see if you can got the error messages from the system. Thanks.

mss1010 commented 4 years ago

If the developers will not react and comment within the next 2 days, I guess we should inform media sites that the app is basically disfunctional.

You are of course free to inform whoever you see fit about this issue. But keep in mind that the app is only facing issues in a small set of edge-cases, we are already investigating this issue (as visible by the assigned status) and we have other issues with higher priority (e.g., the unexpected error codes from the system which we have to investigate together with Apple).

I think there is a misunderstanding about the scope of this bug. It is not only happening in a small number if edge cases, but for every single device I checked it. I think in the first days some users maybe opened the app sometimes manually because it’s something new and interesting. But most users just will install the app ans NOT check it regularly. For these (which we can guess is a BIG MAJORITY) the app DOES NOT WORK. They will not get a warning about any exposure.

tkowark commented 4 years ago

@mss1010 we do understand this issue, but for many devices it is working as expected while for others it was mostly matter of not activating background app refresh properly: https://www.coronawarn.app/de/faq/#no_risk_update_ios

We are not sure how many devices you have tested, but rest assured that we are also using the app ourselves and do not experience this issue on a large scale. Could you also try the manual update as suggested above to see whether an underlying Error 5, 11, or 13 might hinder proper updates?

mss1010 commented 4 years ago

Hello @tkowark, thanks for your reply.

Ok I see that you are aware of the issue. Regarding the manual update, yes I did this and ir worked, and I did not get any error message in the app.

haosap commented 4 years ago

Hello @tkowark, thanks for your reply.

Ok I see that you are aware of the issue. Regarding the manual update, yes I did this and ir worked, and I did not get any error message in the app.

Hi @mss1010 , Thanks for testing it. Could you please share your screenshot of Kontaktüberprüfung here again? We want to see some pattern from the scheduled date.

i336616 commented 4 years ago

Hi @mss1010 & @PalminX,

Thanks for your updates, they're much appreciated. Our team is looking into this at present, to determine the root cause of this issue.

Here's some more details on our implementation. It's based on the sample code provided by Apple (see the link below). I've been testing this on 4 devices locally, using the following methods:

  1. Triggering simulated background tasks on device, to ensure our code for handling the exposure calculation is executed on receiving the background event, and
  2. Running the application overnight, and logging the execution flow of the background task handling to a file (so that the application doesn't need to be opened to check the risk status, which would otherwise reschedule the background tasks again)

From the documentation below, Apple indicate that, by checking for the app's Exposure Notification entitlement, and using the specific background task identifier (i.e., with a .exposure-notification suffix), the operating system will automatically launch & guarantee more background processing time to the task.

From our logging, we've also verified that setTaskCompleted(success: Bool) is called on the background task when executed, ensuring that the background scheduler does not flag our task as a rogue process.

We've also noticed during our testing that background tasks execute more reliably when the device is plugged in. The tasks will still execute when unplugged, just adhering less strictly to the task's earliestBeginDate, which in any case is not a guaranteed execution time. In addition, we specify nil for the earliestBeginTime for the exposure-notification task. The ExposureNotification framework internally applies a earliest start time of 4 hrs to this task, regardless. From discussion with Apple, this is expected behaviour by design when using the BackgroundTasks framework.

https://developer.apple.com/documentation/exposurenotification/building_an_app_to_notify_users_of_covid-19_exposure (See the section on Create a Background Task to Check for Exposure)

Again, thanks for your feedback on this. We'll also update here with the results of our testing, to keep you informed of our status of this issue.

ay-kay commented 4 years ago

Have you considered using Background Notifications to inform users when new diagnosis keys become available? This could grant the app execution time on demand, independent of any proprietary iOS scheduling algorithms and would allow users to be informed more quickly. When combined with the existing background tasks, this might improve the reliability and efficiency of background updates.

JThoennes commented 4 years ago

Thanks for the detailed update(s). Now I have got two questions:

  1. What exactly means "manual update"? Just opening the app?
  2. From the last comment I conclude that apps with the .exposure-notification suffix get privileged treatment by iOS. What happens in power saving mode? I usually have it switched on and notice that the app is not updated as if the background actualization is not properly switched on.

In addition, normal users are not even aware of these settings for background processing and also not aware of such funny things as FAQ... what is this? ;-) So the app should exercise some self-control and recommend the user to update and check is settings if it is not updated regularly. Ideally, the server could provide an expected next update time and if the app is consistently off schedule the user should be alerted and advised about remedies.

mss1010 commented 4 years ago

Hello @tkowark, thanks for your reply. Ok I see that you are aware of the issue. Regarding the manual update, yes I did this and ir worked, and I did not get any error message in the app.

Hi @mss1010 , Thanks for testing it. Could you please share your screenshot of Kontaktüberprüfung here again? We want to see some pattern from the scheduled date.

Yes, here is my screenshot from today. Today I waited for the exact time (11:49) and then opened the app several times until it got the update. A side-note: What I noticed today is, that the biggest package has 1450 keys, exactly the same number like the biggest package yesterday.

IMG_1113

gigiCom commented 4 years ago

If the developers will not react and comment within the next 2 days, I guess we should inform media sites that the app is basically disfunctional.

You are of course free to inform whoever you see fit about this issue. But keep in mind that the app is only facing issues in a small set of edge-cases, we are already investigating this issue (as visible by the assigned status) and we have other issues with higher priority (e.g., the unexpected error codes from the system which we have to investigate together with Apple).

I strongly disagree! This is not only a corner case, in contrary, this is a major case because if the app is never started, which I assume is THE major case, it won't inform users about potential health risks, if not this is a major case, what then?

gigiCom commented 4 years ago

If the developers will not react and comment within the next 2 days, I guess we should inform media sites that the app is basically disfunctional.

You are of course free to inform whoever you see fit about this issue. But keep in mind that the app is only facing issues in a small set of edge-cases, we are already investigating this issue (as visible by the assigned status) and we have other issues with higher priority (e.g., the unexpected error codes from the system which we have to investigate together with Apple).

I think there is a misunderstanding about the scope of this bug. It is not only happening in a small number if edge cases, but for every single device I checked it. I think in the first days some users maybe opened the app sometimes manually because it’s something new and interesting. But most users just will install the app ans NOT check it regularly. For these (which we can guess is a BIG MAJORITY) the app DOES NOT WORK. They will not get a warning about any exposure.

Let me clarify my original bug report. The IDs get updated if the app remains open, even in the ebackground, but they don't if the app remains closed, that's the point.

gigiCom commented 4 years ago

@mss1010 we do understand this issue, but for many devices it is working as expected while for others it was mostly matter of not activating background app refresh properly: https://www.coronawarn.app/de/faq/#no_risk_update_ios

We are not sure how many devices you have tested, but rest assured that we are also using the app ourselves and do not experience this issue on a large scale. Could you also try the manual update as suggested above to see whether an underlying Error 5, 11, or 13 might hinder proper updates?

All you are missing is mentioned in the original bug report and its attachments. To mention is again: YES, background tasks are enabled.

The bug happens when the app is closed, so manually update something is not related to the bug report.

i336616 commented 4 years ago

@mss1010 we do understand this issue, but for many devices it is working as expected while for others it was mostly matter of not activating background app refresh properly: https://www.coronawarn.app/de/faq/#no_risk_update_ios We are not sure how many devices you have tested, but rest assured that we are also using the app ourselves and do not experience this issue on a large scale. Could you also try the manual update as suggested above to see whether an underlying Error 5, 11, or 13 might hinder proper updates?

All you are missing is mentioned in the original bug report and its attachments. To mention is again: YES, background tasks are enabled.

The bug happens when the app is closed, so manually update something is not related to the bug report.

Thanks, @gigiCom. I've tested the background tasks today, & checked the logs. They are definitely being triggered by the operating system, & being rescheduled on completion. If, as you say, the exposure checks are not being carried out during the background task execution, then that helps us isolate the root cause of this issue.

PalminX commented 4 years ago

@i336616, thanks for the update, and for pointing out the relevant Apple documentation.

My experience is that these issues are really hard to debug, and that different devices can act extremely different due to overall system load, quite independent from background refresh settings.

The debugging approach that you mentioned makes a lot of sense, but as long as this isn't done on devices which exhibit this issue, it will be hard to find the root cause.

What I noticed in the Apple documentation example is that their task has an explicit expirationHandler, defined which cancels the running exposure detection process.

In the implementation in ENATaskScheduler.swift, I don't see an expirationHandler.

In my understanding, this means that when iOS decides that time has run out for the BGProcessingTask, it will just kill it, and the task will not be able to complete.

Can you comment on this?

i336616 commented 4 years ago

@i336616, thanks for the update, and for pointing out the relevant Apple documentation.

My experience is that these issues are really hard to debug, and that different devices can act extremely different due to overall system load, quite independent from background refresh settings.

The debugging approach that you mentioned makes a lot of sense, but as long as this isn't done on devices which exhibit this issue, it will be hard to find the root cause.

What I noticed in the Apple documentation example is that their task has an explicit expirationHandler, defined which cancels the running exposure detection process.

In the implementation in ENATaskScheduler.swift, I don't see an expirationHandler.

In my understanding, this means that when iOS decides that time has run out for the BGProcessingTask, it will just kill it, and the task will not be able to complete.

Can you comment on this?

Sure, understood, I had concerns myself in relation to exactly that. We've brought this up with the team from Apple, and they have confirmed that for the .exposure-notification task, it is not necessary to implement the expirationHandler, if there is no cleanup required. Also, they have confirmed that even if the device is in low power mode, the operating system should still execute this task.

PalminX commented 4 years ago

Sure, understood, I had concerns myself in relation to exactly that. We've brought this up with the team from Apple, and they have confirmed that for the .exposure-notification task, it is not necessary to implement the expirationHandler, if there is no cleanup required. Also, they have confirmed that even if the device is in low power mode, the operating system should still execute this task.

If that's from the horse's (Apple's) mouth, then it could be that it's correct... I would not really bet on it though. How long would executeExposureDetectionRequest() typically take?

i336616 commented 4 years ago

Sure, understood, I had concerns myself in relation to exactly that. We've brought this up with the team from Apple, and they have confirmed that for the .exposure-notification task, it is not necessary to implement the expirationHandler, if there is no cleanup required. Also, they have confirmed that even if the device is in low power mode, the operating system should still execute this task.

If that's from the horse's (Apple's) mouth, then it could be that it's correct... I would not really bet on it though. How long would executeExposureDetectionRequest() typically take?

It shouldn't take more than a couple of minutes, for the most part. Will check and verify that with the rest of the team.

i336616 commented 4 years ago

Sure, understood, I had concerns myself in relation to exactly that. We've brought this up with the team from Apple, and they have confirmed that for the .exposure-notification task, it is not necessary to implement the expirationHandler, if there is no cleanup required. Also, they have confirmed that even if the device is in low power mode, the operating system should still execute this task.

If that's from the horse's (Apple's) mouth, then it could be that it's correct... I would not really bet on it though. How long would executeExposureDetectionRequest() typically take?

It shouldn't take more than a couple of minutes, for the most part. Will check and verify that with the rest of the team.

We confirmed with our team this morning that the exposure notification background task should currently take at most 1 minute or thereabouts. Also, in regards the background task behaviour for the exposure notification, yes, this was confirmed directly with Apple. Summarising a conversation we had yesterday afternoon with them, all background tasks for get a priority scoring that the operating system uses to determine whether or not it will be executed. The exposure notification task, as defined above, is automatically granted the highest priority possible, which allows it to bypass the device's low power mode setting, ensuring execution.

gigiCom commented 4 years ago

it seems that there were some findings.

@i336616 could you be so kind to answer to my bug report appropriately. Btw. the thing is still on status open, which is obviously not the case.

To sum my bug report up, I argued that the system does not do any ID actualization and therefore it does not do any ID matching if the app is closed, because the time stamp of the last ID actualization does not lie in the past, but it is always the time when the app gets started.

PalminX commented 4 years ago

For the last few days, the updates were done in the background. So I think the assessment that this is not a hard "doesn't work", but that it is more of a transient delay (due to iOS note necessarily running the bg tasks with high enough priority), is valid. This still means that for some devices, the update could be delayed for an undetermined time.

i336616 commented 4 years ago

For the last few days, the updates were done in the background. So I think the assessment that this is not a hard "doesn't work", but that it is more of a transient delay (due to iOS note necessarily running the bg tasks with high enough priority), is valid. This still means that for some devices, the update could be delayed for an undetermined time.

@Palminx I agree with your assessment. I've been testing on my devices locally, and am seeing the same issues you describe. We know that the exposure-notification background task is not guaranteed, but (according to Apple), they should receive a higher priority than regular background tasks. Having inspected the logs for bgtask execution, there definitely appears to be some inconsistency with how this is executed, and they do not seem to be consistently getting the necessary priority to execute.

i336616 commented 4 years ago

For the last few days, the updates were done in the background. So I think the assessment that this is not a hard "doesn't work", but that it is more of a transient delay (due to iOS note necessarily running the bg tasks with high enough priority), is valid. This still means that for some devices, the update could be delayed for an undetermined time.

@gigiCom Specifically in relation to the time of the last actualization displayed in the app, we added a fallback on re-entering the app, that if the device is automatic mode, bringing the app back to the foreground will automatically attempt to carry out a risk assessment. This will execute the API call if the last actualization occurred over 24 hours ago. This may explain why the app shows the most recent time, as opposed to the expected scheduled time, particularly if the background task is not running correctly on your device (see my comment to @PalminX in relation to the reliability of the bgtask execution)

i336616 commented 4 years ago

For the last few days, the updates were done in the background. So I think the assessment that this is not a hard "doesn't work", but that it is more of a transient delay (due to iOS note necessarily running the bg tasks with high enough priority), is valid. This still means that for some devices, the update could be delayed for an undetermined time.

@PalminX I agree with your assessment. I've been testing on my devices locally, and am seeing the same issues you describe. We know that the exposure-notification background task is not guaranteed, but (according to Apple), they should receive a higher priority than regular background tasks. Having inspected the logs for bgtask execution, there definitely appears to be some inconsistency with how this is executed, and they do not seem to be consistently getting the necessary priority to execute.

Also, I'm in communication with Apple colleagues, and am forwarding on our logs and captured sysdiagnose files for their engineers to provide assistance with determining the issue.

mkuhn commented 4 years ago

Would it be possible to set a shorter interval, e.g. every 12 hours instead of 24 hours? Then a delay by an hour or two wouldn't matter too much, as the update frequency would still be higher than now.

BastianZim commented 4 years ago

For the last few days, the updates were done in the background. So I think the assessment that this is not a hard "doesn't work", but that it is more of a transient delay (due to iOS note necessarily running the bg tasks with high enough priority), is valid. This still means that for some devices, the update could be delayed for an undetermined time.

@i336616 Same here. The background check is being done but at an interval of 24h + x with x being around 2 hours, meaning that after 12 days a day is "skipped".

gigiCom commented 4 years ago

For the last few days, the updates were done in the background. So I think the assessment that this is not a hard "doesn't work", but that it is more of a transient delay (due to iOS note necessarily running the bg tasks with high enough priority), is valid. This still means that for some devices, the update could be delayed for an undetermined time.

@PalminX Could you briefly explain how one can verify that the updates were done in the background on iOS, how did you find this out?

BastianZim commented 4 years ago

@gigiCom On your iPhone: Settings > Privacy > Health > COVID-19 Exposure Logging > Exposure Checks

gigiCom commented 4 years ago

Would it be possible to set a shorter interval, e.g. every 12 hours instead of 24 hours? Then a delay by an hour or two wouldn't matter too much, as the update frequency would still be higher than now.

The next one comes and asks why not using 6 hours etc.

More interesting is the question why at all the development group decided to take these famous 24 hours and not another timeframe. Which server load estimation was the basis for that decision, for instance.

gigiCom commented 4 years ago

@gigiCom On your iPhone: Settings > Privacy > Health > COVID-19 Exposure Logging > Exposure Checks

10x!

BastianZim commented 4 years ago

The next one comes and asks why not using 6 hours etc.

@gigiCom I'm not from the development team so take this with a grain of salt but I think this is restricted by Apple as the API only allows calls at a certain rate.