corona-warn-app / cwa-app-android

Native Android app using the Apple/Google exposure notification API. 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
2.44k stars 495 forks source link

Risk state is not updated. #621

Closed DannySchumann closed 4 years ago

DannySchumann commented 4 years ago

Describe the bug

The app is running since 16th of June (more than two days now). It shows "2 von 14 Tagen aktiv" and "Aktualisiert: Vorgestern 12:07". The app was never deactivated.

Expected behaviour

It should never show "Aktualisiert: Vorgestern" because the app is supposed to update the state every day.

Technical details

I run it on a Honor 10 Smartphone. AppVersion 1.0.2.

Fabus1184 commented 4 years ago

Do you have restricted app background tasks in your system settings ?

DannySchumann commented 4 years ago

Do you have restricted app background tasks in your system settings ?

I don't think so. The app settings in the OS is configured to "Hintergrundaktivität nicht eingeschränkt".

bersbersbers commented 4 years ago

I can confirm this report: running since 2 days, did a couple of tests in-between (disabled bluetooth, disabled the exposure API, all just for a few seconds), but had the app running constantly. I definitely opened it yesterday, too. Still, says "Updated: 2 days ago, 9:25 AM". This is on a Huawei P30 - installed the app, did not mess with any background settings (which does mean the OS might shutdown the app in the background).

Edit: I let my phone unlocked, the screen on and the app in the foreground from 9:20 to 9:27 am. The display changed to "Updated: Jun 16, 9:25 AM", so it seems no update occurred at that specific time. Closed the app and restarted it, same thing. All that was on version 1.0.0, I now updated to version 1.0.2.

CBRWLF98 commented 4 years ago

I am having the same issue. "Updated: 2 days ago, 9:33am". I am using the Huawei P10 lite and my background settings are also untouched.

gizmo21 commented 4 years ago

Same issue on Huawei P10 Shows vorgestern instead of gestern. Just installed App so far, did no optimization.

Now, today changed Menü "App Start" on CWA App to "Manual" and put all switches ON. So far no imediate change.

Huawei app restriction experts needed.

CBRWLF98 commented 4 years ago

Update: My Risk state just updated, now it says: today, 10:27 and it also says 2 days active. I have opened the app several times yesterday but nothing happened. So in conclusion my status has not been updated for 2 days and 1 hour

bauerj commented 4 years ago

Same here (Huawei P20 Pro). Is it possible to manually trigger an update?

AlexanderAlferov commented 4 years ago

Thank you so much for your issue report! Unfortunately, there are some known issues with background tasks on some firmware.

While we are investigating this issue, you could turn on manual mode: Settings -> Apps -> Corona Warn App -> Battery -> turn off Allow background activity After this, please, kindly open the application and check if Update (Aktualisieren) button is available.

Thank you. Best regards, Alex

datenstau commented 4 years ago

Same issue on P-Smart 2019. A manual update function would be useful.

juefried commented 4 years ago

Same issue here: Xiaomi Mi 9T Pro. Also, following the instructions above (with small differences in the path to the settings) did not bring up the „Aktualisieren“-button.

fjalowski commented 4 years ago

Same problems with Huawei Mate 10 Pro. I tried playing around with the energy saving/battery settings for the app, but so far I couldn't see a change in behavior. Still stuck on last update being two days ago.

gizmo21 commented 4 years ago

My settings (see above) and app update to 1.0.2 triggered the inapp download. But not immediately, took a while.

Also tried what Alexander suggested which (as I understand it) could be used as manual trigger, but even with force closing app and disabling background data, the mentioned button does not appear. Perhaps cause I now already updated today.

DannySchumann commented 4 years ago

Status update

My app now shows "Risiko-Ermittlung nicht möglich. Ihre Risiko-Ermittlung konnte seit mehr als 24 Stunden nicht aktualisiert werden" and a Button "RISIKO-ERMITTLUNG EINSCHALTEN" appears, but the "RISIKO-ERMITTLUNG" is still active. It shows "RISIKO-ERMITTLUNG AKTIV" in the status bar.

fjalowski commented 4 years ago

Can confirm that, as gizmo21 said, turning app start from automatic to manual in the power saving/battery settings and setting the other three power options to on led to a successful update after a while.

AlexanderAlferov commented 4 years ago

@juefried, this is something new. Could you, please, provide the full path to that setting on your device? Thank you!

Best regards, Alex

juefried commented 4 years ago

@juefried, this is something new. Could you, please, provide the full path to that setting on your device?

Einstellungen > Apps > Apps Verwalten > Corona-Warn

There I disabled Autostart, in addition I set Energiesparmodus to "Hintergrundaktivitäten beschränken", then "Beenden erwingen", then restart of the App.

What I also find strange is, that for the CWA no data-transfer has been recorded today. CWA 20200618

juefried commented 4 years ago

While making the screenshot, the CWA suddenly updated the data :-o

DannySchumann commented 4 years ago

My app updated its state now (after two days). Its the same like described by CBRWLF98.

corneliusroemer commented 4 years ago

This possibly belongs to the class of "problems related to failure to download keys in set window, e.g. due to no internet" https://github.com/corona-warn-app/cwa-app-android/issues/621 https://github.com/corona-warn-app/cwa-app-android/issues/632 https://github.com/corona-warn-app/cwa-app-android/issues/603

bersbersbers commented 4 years ago

After updating to 1.0.2 and plugging in my phone last night (don't do that daily), risk was updated yesterday, 11:46 PM. I did not tinker with background/battery settings (yet).

gizmo21 commented 4 years ago

Same issue on Huawei P10 Shows vorgestern instead of gestern. Just installed App so far, did no optimization.

Now, today changed Menü "App Start" on CWA App to "Manual" and put all switches ON. So far no imediate change.

Huawei app restriction experts needed.

My settings (see above) and app update to 1.0.2 triggered the inapp download. But not immediately, took a while.

Also tried what Alexander suggested which (as I understand it) could be used as manual trigger, but even with force closing app and disabling background data, the mentioned button does not appear. Perhaps cause I now already updated today.

Just as info from another day later: Huawai P10 updated exactly 24h later automatically as other devices do - with my settings above: App-Start to manual and all three switches to ON

For me it seems to to fixed that way.

Pozzdamm commented 4 years ago

... Ich habe dasselbe Problem, Gerät Redmi 8A. (Stand 20.06.2020 ca. 08:00 Uhr) => Problem ist seit 20.06.202, 10:21 Uhr ohne eigenes Zutun gelöst.

birgit-xy commented 4 years ago

Uh, yesterday I posted below #637 - this is obviously wrong. The problem is #621 for Xiaomi Redmi Note 8 T - Android 9 . App installed 16th of June - no update till now, no Akku used

ikarisan commented 4 years ago

Same here with my Huawei P20pro CLT-L29 (Android 10). Last time I got an updated status was the morning of June 18.

skick3 commented 4 years ago

Das klingt nach einem Xiaomi und Stromsparmodus-Problem. Die Lösung:

Hier müsst Ihr den Punkt "Autostart" beziehungsweise "App-Start" suchen. Bei Huawei-Smartphones findet sich dieser je nach OS-Version entweder direkt im "Apps"-Menü oder bei den Stromspar-/Akku-Optionen. Bei Xiaomi-Telefonen liegt der Punkt im Unterverzeichnis "Rechte" unter "Apps" verborgen.

That sounds like a Xiaomi and power saving problem. The solution:

Here you have to search for "auto-start" or "app-start" On Huawei smartphones, depending on the OS version, you can find it either directly in the "Apps" menu or in the power save/battery options. On Xiaomi phones, the item is hidden in the "Apps" subdirectory in the "Rights" folder.

Quelle/Source: https://www.androidpit.de/corona-warn-app-probleme-loesungen-fehler-bugs

birgit-xy commented 4 years ago

Heute wurde aktualisiert. Gestern die App de- und wieder installiert. Autostart aus. Keine Energiebeschränkung. Bluetooth und GPS sowieso. Eine Berechtigung (Nachrichten). Endlich!!! Dafür habe ich jetzt 4 Tage herumgehampelt. Xiaomi Redmi Note 8 T. Wollen hoffen, dass es so bleibt.

mbw83 commented 4 years ago

Das klingt nach einem Xiaomi und Stromsparmodus-Problem. Die Lösung:

Hier müsst Ihr den Punkt "Autostart" beziehungsweise "App-Start" suchen. Bei Huawei-Smartphones findet sich dieser je nach OS-Version entweder direkt im "Apps"-Menü oder bei den Stromspar-/Akku-Optionen. Bei Xiaomi-Telefonen liegt der Punkt im Unterverzeichnis "Rechte" unter "Apps" verborgen.

That sounds like a Xiaomi and power saving problem. The solution:

Here you have to search for "auto-start" or "app-start" On Huawei smartphones, depending on the OS version, you can find it either directly in the "Apps" menu or in the power save/battery options. On Xiaomi phones, the item is hidden in the "Apps" subdirectory in the "Rights" folder.

Quelle/Source: https://www.androidpit.de/corona-warn-app-probleme-loesungen-fehler-bugs

Sorry, but I think this is wrong. As also can be seen in #637 (which I think is related), this doesn't help in all cases and if maybe just for the moment. In Addition, as far as I understand, the big advantage of using the API of Google/Apple is, that the App doesn't have to run respectively be active the whole day. It simply has to download the IDs of infected people from a server every 24 hours. And it doesn't matter if this is done every 24 hours or more or less frequent. Even if the app is doing more than this (but what else should the app do?), than it must be possible to do this without these settings. At least all my messaging, email and other apps which have to run respectively sync 24/7 are working without these weird settings.

The IT "expert" of bayerischer Rundfunk said on tuesday, that the CWA definitely is not a "Banana Software". I'm not quite sure about this....

tkowark commented 4 years ago

In the meantime, the team identified a workaround that solved the problem at least for some users: https://www.coronawarn.app/de/faq/#no_risk_update. Would be great if you can let us know whether it worked for you as well.

Of course, the team is nevertheless still working on a proper solution for the issue.

mbw83 commented 4 years ago

In the meantime, the team identified a workaround that solved the problem at least for some users: https://www.coronawarn.app/de/faq/#no_risk_update. Would be great if you can let us know whether it worked for you as well.

Of course, the team is nevertheless still working on a proper solution for the issue.

I still can not see the point, why setting this (weird) options should help solving the problem. As pointed out by @mh- in this thread of the cwa-documentation#236 three attemps within 1 minute are done to get the data from the server. If this fails (this can also be because the internet is not available), the next attempt will be done 24 hours later. And as I also said before, my messaging (Signal, Telegram, WhatsApp, ...) and eMail (K-9 Mail, GMail, ...) apps are also able to retrieve the data on my phone without adjusting any energy options.

I do not want to offend anybody, I'm just trying to understand why this should help.

mh- commented 4 years ago

@mbw83 I'm waiting for the commit mentioned here to be published.

mbw83 commented 4 years ago

@mbw83 I'm waiting for the commit mentioned here to be published.

Yes, I also saw that, but this still doesn't have to do anything with energy saving options. The current state is just a Bug and has nothing to do with vendors not fully compliing with the Android specification. This can be an additional reason of course, but not the main one.

mbw83 commented 4 years ago

@mbw83 I'm waiting for the commit mentioned here to be published.

Seems that it got published now. Google play just updated my CWA and the risk state got updated when starting the App (or maybe automatically just seconds before).

tkowark commented 4 years ago

@DannySchumann does the risk state update now work for you, too, with the latest app version?

DannySchumann commented 4 years ago

Yes it is working now. I had only a single missing day.

jakobmoellerdev commented 4 years ago

Since the issue seems to be resolved for all parties. Please feel free to open up a follow-up issue if you still encounter similar errors. Thanks everyone!

bersbersbers commented 4 years ago

I hate to ask this, but is it ensured that the risk state updates without changing battery settings and without opening the app? I assume that most of the people here checked the risk state updates (probably) after changing battery settings and (surely) by opening the app. I myself have not yet changed battery settings yet, and it seems the risk state is (only) updated upon starting the app.

So what happens with people who install the app in a rush, but don't change battery settings and then never open the app again? They will probably not have their risk state updated, nor be aware of this. Previously, I had problems with missed notifications with the Signal messaging app for weeks (on a Huawei P30) until I changed battery settings - this would be dramatic for CWA.

ikarisan commented 4 years ago

I had problems with missed notifications with the Signal messaging app for weeks (on a Huawei P30) until I changed battery settings - this would be dramatic for CWA.

On Android this may be prevented by showing a static/fixed notification and/or by displaying an icon in the notification bar. As far as I know this is the way the "Mi Band Notify" app handles this.

jakobmoellerdev commented 4 years ago

@bersbersbers There are battery optimisation implications with some manufacturers (Honor being one of them) that we are currently tackling and trying to resolve by specifically designing a solution that asks for ignoring these restrictions to allow optimal operation for these cases. One of the ideas is to introduce a dedicated permission resolution like the immuni app, however there are certain UX implications and this is also resulting in less trust for people who would not even need that permission check.

I would thus ask for your patience until we came to a final conclusion on how to finally resolve that topic. In the meantime, by going into the app now and then or disabling battery optimisations should help for almost all devices that have this problem. It is unfortunate that we then have to include a workaround only applicable for certain devices and manufacturers but this is the general disadvantage of the Android ecosystem and we will try to get around this problem as good and as soon as we can responsibly. We are aware of the implications this might have, but have to think of the (now) big user base we are targeting and can and will not take this decision lightly.

@ikarisan The "static/fixed" notification is a so called foreground service that handles completely different to our current background job solution, but is also being investigated as one of the possible resolutions.

mhellmeier commented 4 years ago

We just talked and discussed about exactly this problem in #522 on the release day. I also tried to make a proposal without any response. Sad story that the mentioned issue has been largely ignored and this bug could have been fixed much sooner and now makes such big waves. :disappointed: