Cwa-documentation: Documentation of robustness concept of the daily check?

Created on 24 Sep 2020  路  13Comments  路  Source: corona-warn-app/cwa-documentation

Avoid duplicates

  • [ ] Question is not already answered in the FAQ
  • [ ] Question has not already been asked in another issue

Your Question


Do you have a documentation of your robustness concept of the daily check?
Like: triggering events, frequency, constraints, fallback strategies, the wake-up, etc
Alternatively: can you describe it "in a nutshell"?

  • Source File:
  • Line(s):
  • Question:

Most helpful comment

iOS: Since. 13.6.1 the active app/region gets their exposure-notification background task called once per day most likely around 22:00-3:00 because the phone is on power, has internet and low cpu usage. Only internet is required by the CWA.
The background task is retriggerd every 2h our and executed when internet is available and the OS deceide there is enough cpu time and memory left. The background task checks if the exposure check was done in the last 24h if not it will download the key file and do an exposure checks if this fails it will retry in 2h.
iOS only is at the moment a scheduled Notification after 36h without background task the user will receive a push notification. This is not possible with Android.

Android: the Google Play WakeUpService will bind the CWA as an service and give them 5seconds time to scheduler a worker this will execute the onCreate method a exposure Check is triggered as well a rescheduling a new background task. The rest is the same like on iOS

All 13 comments

iOS: Since. 13.6.1 the active app/region gets their exposure-notification background task called once per day most likely around 22:00-3:00 because the phone is on power, has internet and low cpu usage. Only internet is required by the CWA.
The background task is retriggerd every 2h our and executed when internet is available and the OS deceide there is enough cpu time and memory left. The background task checks if the exposure check was done in the last 24h if not it will download the key file and do an exposure checks if this fails it will retry in 2h.
iOS only is at the moment a scheduled Notification after 36h without background task the user will receive a push notification. This is not possible with Android.

Android: the Google Play WakeUpService will bind the CWA as an service and give them 5seconds time to scheduler a worker this will execute the onCreate method a exposure Check is triggered as well a rescheduling a new background task. The rest is the same like on iOS

@thomasaugsten
So a iOS user gets an Push Notification from the App if the App hasn't done any Background task (Risk calculation/download new Files). But this solution has the problem that also unsuccessful File Downloads in the Background (empty records in "Begegnungs眉berpr眉fungen") are counted as Background Tasks and so the Push Notification gets rescheduled to 36h, right?

This is correct at the moment but we will improve this and reschedule after successful exposure check

The background task is retriggerd every 2 hour [...] checks if the exposure check was done in the last 24h

Ah, so this explains the drift of the daily check. Earliest 24h after yesterdays check; but maybe later (max +2h), depending at what time iOS schedules this task again.

Ah, so this explains the drift of the daily check. Earliest 24h after yesterdays check; but maybe later (max +2h), depending at what time iOS schedules this task again.

The max +2h is maybe on the paper right, but very often I have
a) empty Background checks
b) larger gaps (+5h)
c) absolute no Background checks on a day (maybe some failed ones, but also days without any try)

One more question for @thomasaugsten
Are the Background checks (download new files) only performed if Bluetooth is activated?

This can happens because of internal decision of the OS low memory or high cpu usage or bad internet connection
I think yes because the ENF needs to be active to check the diagnosis keys without bluetooth the ENF returns disabled

Okay I see, this was also my assumption.
Thanks @thomasaugsten

The background task is retriggered every 2 hour and executed when internet is available

Do you know what happens when internet coverage is lost during the check? Let's say after the download of new risk params and keys, but during the key matching and risk calculation? Will the iOS continue the background task processing, or will it put the running task on hold until internet is back again? (Maybe this is worth a question to Apple?)

iOS is also fetching an ENF config if this fails also the ENF exposure check will fail and postponed

iOS is also fetching an ENF config

So, you provide the URL, and ENF / iOS pulls the config file from the server? Interesting, I was not aware of this (or did I misunderstand your statement?)

Recently I saw a very strange pattern: a gap of 4 hours after 10 files, but after this gap it seemed just to continue with the remaining four files.
Can this be explained by no internet? Or any other ideas?

@ndegendogo See this Issue: https://github.com/corona-warn-app/cwa-app-ios/issues/1063 (better, this comment: https://github.com/corona-warn-app/cwa-app-ios/issues/1063#issuecomment-678810309)

@ndegendogo No Apple has an internal configuration file which will fetch by the ENF to get the for example the bundle ids with a valid entitlement.
This can be explained by no internet, bad internet, high cpu usage or low memory of another app or battery state this is the decision of iOS where we have no influence.

@Ein-Tim yes, exactly this pattern.

This is a little bit confusing

definitely!

@thomasaugsten Thanks for all your explanations! Currently no more questions, so I am closing this ticket now.

Was this page helpful?
0 / 5 - 0 ratings