Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically download daily keys #57

Open
schmittlauch opened this issue Oct 8, 2020 · 2 comments
Open

Automatically download daily keys #57

schmittlauch opened this issue Oct 8, 2020 · 2 comments

Comments

@schmittlauch
Copy link

Currently, the download of the daily published new infection keys need to be triggered manually by pressing a button.
This is prone to human error, as users might easily forget to do so and are not warned in case of an exposure. I suggest automatically downloading the new keys daily if an internet connection is available. Using the time of the first download at the initial run of the app as scheduled download time on all consecutive days as well is how the CWA tries to spread out the downloads over a longer time frame. I deem this to be a good approach.

When concerned about using up mobile data, at least in Germany the CWA servers are all zero-listed. So downloading the keys does not affect the users mobile data cap.
But as a compromise for an approach that works outside of Germany as well, the scheduled download might (optionally?) just run when connected via WLAN.

@llewelld
Copy link
Owner

Thanks for the info about mobile data, that's very useful to know. And I agree this is something that should be implemented, but I've been struggling to decide on the best way to do it.

It would be relatively straightforward to get the app to trigger the daily update along the sensible lines you've suggested, as long as the app is running (i.e. showing with a cover). The difficulty is to get it to work while the app is closed (doing one and not the other may give users a false sense of security).

I don't want to introduce the update to the existing daemon, because this breaks the careful separation between the GApple API functionality and the functionality specific to the Corona Warn App.

This leaves the options of running a separate daemon to perform daily updates, or possibly triggering the main app to run daily as a cron job (or equivalent) but without showing the UI (and if the UI is already running, this would have no effect). I'm more inclined towards this latter option, but it needs a bit more thought.

@schmittlauch
Copy link
Author

I don't want to introduce the update to the existing daemon, because this breaks the careful separation between the GApple API functionality and the functionality specific to the Corona Warn App.

A compromise that still requires just a single daemon but maintains the separation of concerns is providing an (optional) hook command to the daemon, that shall be invoked periodically.
This way either a separate binary or the GAP app with a special flag can do the key update, but are invoked by a daemon started like contracd --key-fetch-hook="/usr/bin/harbour-contrac --update-keys".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants