Cwa-app-ios: When does CWA download new data?

Created on 6 Mar 2021  路  10Comments  路  Source: corona-warn-app/cwa-app-ios

Avoid duplicates

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

Your Question

I noticed that CWA sometime checks my exposure log when I open the app when 4h passed since the last check, even though I'm not connected to the internet.

The EN-Log, in the settings, also shows that CWA has "downloaded" new hashes at that point of time.
How is this possible when I'm not connected to the internet?
When does CWA download new data?


Screen recordings

https://user-images.githubusercontent.com/67682506/110204654-848be980-7e74-11eb-87dc-a540199c4ed8.mp4

https://user-images.githubusercontent.com/67682506/110204660-8786da00-7e74-11eb-8890-6e3caa49f03a.mp4

Additional Information

I noticed that CWA only says "Check is running" and not "Downloading new Data" so it seems like it has already downloaded new data. But when? The last time I was connected to the internet?

question

Most helpful comment

@Ein-Tim
as @sin-azucar already pointed out the key download and the ENF call (matching procedure) are decoupled.

This decoupling is reasonable and a good idea, because those two steps have different constraints (internet or even WLAN for the download, rate limiting to 4-hour interval for ENF).

All 10 comments

@Ein-Tim ok, we will bring this question to a dev. Interesting ...

@ndegendogo

Would you like to try if you can reproduce it?

Steps to reproduce

  1. Be connected to the internet until ca. 5 minutes before the next check should happen
  2. Turn off your internet connection. Mobile Data and WiFi.
  3. Open CWA 1 minute after the planned time of the check
  4. See that a check happens
  5. See that the EN-Log shows that there are new files downloaded

I think the answer is in this comment.
https://github.com/corona-warn-app/cwa-app-ios/issues/1631#issuecomment-752753980

Apparently, downloading data and actually feeding new data into the ENF has been decoupled for quite a while. Background downloads via WiFi can happen more frequently than ENF calls. The latter one requires no internet connection, of course.

So in essence, the timestamps in the ENF logs do not tell you when the data was actually downloaded.

@sin-azucar

Thank you so much for the link to this comment. Sadly, this is nowhere really documented (so I forgot it, even though I reacted with thumbs up) 馃槄

I will test some things and come back here ASAP.

Thanks again and a good night.

@sin-azucar thanks for the link also from my side. I remembered that I had seen "something similar" before, but would not have found it.

The latter one requires no internet connection, of course.

Also here I remember a statement from the devs that the Apple ENF indeed uses internet (for verification of the entitlement of the app iirc). But this is long ago, and may have changed meanwhile with newer iOS versions (maybe they use it but don't mandate it).

@Ein-Tim does the link that @sin-azucar found, answer your question? Or what else do you want - an 'official' answer from the devs that it is still true? Would you regard a pointer into the source code sufficient?

@ndegendogo

I would like to test some things (like WLAN off in the last 4 hours and open CWA when check can happen, mobile data in the 4 hours before the check, etc.)

An answer form the devs on the details would be quite nice (does it really make sense to carry out a check offline although only one new hash instead of four were downloaded (saw this in my log), etc.)

Today I again saw that CWA offline carried out a risk check, and when looking at the EN-Log CWA only downloaded one instead of four new hourly files...


Screen shots

Check (online) at 06:39:

Check (offline) at 10:40:

If this is the intended behavior, I'll close this issue, since I checked all other thinks and it seems to work quite good (besides of this that only 1 file instead of 4 is checked).

I've made all my tests and everything seems to work as intended.

@Ein-Tim
as @sin-azucar already pointed out the key download and the ENF call (matching procedure) are decoupled.

This decoupling is reasonable and a good idea, because those two steps have different constraints (internet or even WLAN for the download, rate limiting to 4-hour interval for ENF).

Was this page helpful?
0 / 5 - 0 ratings