-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Notifications fail when changing network (MINIMAL edition) #3235
Comments
hi please do not delete the issue template that got presented when the issue is created, all requested information is important to help you out. |
Let me reformat everything in the issue template format. One second please... |
Looking for the actual app version here. Settings > Companion App > Version (bottom of settings) Please also look at the companion app logs when the issue occurs Settings > Companion App > Show and share logs we need to see the on device logs when this issue occurs. You should actually see the app trying to reconnect every 30 seconds so I don't think a force stop is necessary here unless some other error is occurring which the on device logs will show. |
Stand by for logcat. |
Here are the companion logs. There is obviously nothing on the logs that would indicate an issue since it is the server that can't talk to the client (remember the backtrace), not the other way around. From the perspective of the server, there is a KeyError and nothing more.
I am not seeing any such thing in said logs. Remember: the app is connected to Home Assistant — every dashboard and feature is functional, I can turn lights off and on — it's just local push notifications that cease working. The problem might just be server-side. |
Actually I do see a failure
Which is then followed by our retry attempt
Which then proceeds to fail
but strangely still pings and gets responses
It does appear to be a separate issue because in this particular case you should be seeing an HA core error for "Device not connected to local push". In our case your push token is indeed not provided because the minimal version does not support firebase.
The frontend has a separate websocket connection that is independent of the app and not something we control or use. Given that I see our retry attempt this might just be a core bug and not 2 separate bugs. From the apps perspective we should retry and reconnect. I am not sure why its failing to reconnect but it does seem to be getting an odd response it seems due to the log. |
P.S. still not the correct version listed, that looks to be a frontend version. Settings > Companion App > Application Version Not really needed here based on what I see but in the future the bug may require the correct info :) |
As far as I know that assessment is not correct. Local push does not use Firebase. Clearly the WebSocket connection is working correctly — it appears that what is not working correctly is core noting that my phone is back online with full WebSocket, and using that for push. It may just be a bug in the core tho. The traceback is very clear that there is a KeyError in a coroutine. This would all go away if UnifiedPush was implemented in Home Assistant. |
This error message I linked to is only meant to be shown to devices using local push only (basically the minimal builds that you are on). Push token is part of device registration, its
Correct this looks to be a HA core bug and not a bug with the app itself. |
It could be null or not, but there is code that is not executing because it's not a matter of it being null — the container is throwing a KeyError, so all the code after that... well, it won't run. |
Is this still an issue with the latest HA core update? I think we may need to transfer this issue if it is. |
Yes it is. Please help us transfer this issue. |
Closing due to inactivity. Android issues can't be transferred, so if it is still an issue on the latest core version please create a new issue for core and include the current stacktrace as that appears to be the cause. |
This issue has to do with the fact that:
I am having the exact same issue and obviously this happens on the minimal version since it doesnt use firebase. So is there anything we can do about this to have HA send the notification once the phone reconnects to the internet? Or is this a bug, and is it a bug on Android HA or HA core? @dshokouhi please advise |
Home Assistant Android version:
2022.12.0-minimal
Android version:
13
Phone model:
Pixel 6 Pro
Home Assistant version:
2023.1
Last working Home Assistant release (if known):
Not known. VPN is a new addition to my mix.
Description of problem:
I'm using latest Home Assistant and Companion Android app from F-Droid.
Whenever I change networks (e.g. go off wi-fi, onto mobile, and then turn VPN on) Home Assistant Companion will connect to my home network's (internal IP) Home Assistant server just fine. Same is true when I return home and VPN goes off as the phone connects to wi-fi.
HOWEVER, notifications sent with
notify.notify
do not reach the phone anymore, and sometimes there's a nasty traceback in the log (see below). Only a force stop and then restart of the app re-establishes the local push token, leading to notifications working again.It is important to know that the app is functioning properly after changing networks — but the local push notifications feature is not.
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
Screenshot of problem:
No screenshot. Nothing happens on the phone.
Additional information:
No additional information.
The text was updated successfully, but these errors were encountered: