-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Disconnected web socket connection to backend is not detected #17409
Comments
Its seems like webkit in general is unreliable to detect a broken websocket connection. Besides that did i also read about @karwosts having the same (or similar) issue when his PC wakes up from sleep. As far as i can see its only the backend that pings the frontend. So my thought for a potential workaround/solution for issues where the websocket disconnects could be a timeout in the frontend received from the backend for some time. Or maybe just pinging the backend from the frontend. However i could imagine this could have some other unforeseen side effects. |
In home-assistant/iOS#2219 the same issue is discussed. According to this comment Also i have found other similar issues, that might be caused by something else, but result in the same state of the HA frontend. |
Can confirm this. I have two iPads (Pro1, 2017), as well as iPhones (SE 1, 6). They are wall mounted controllers with the display ‘always on’. When this happens a pull-down to refresh on all the devices is required to restore the connection, which seems to time out on a sporadic basis. I am using the iOS App on all those devices. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This is still a problem. |
dev...leonardmgh:homeass-frontend:fix-halfopen-websocket |
an active ping is exactly the fix as I suggested before i find this issue. please make it important priority. stability is required by screens that show home assistant as main and only UI. opening frontend for "manual" usage from time to time, is not "smart" way. any manual usage is not smart enough |
You are welcome to review my PR and give some feedback :) #18934 |
the patch works for me, it should be merged and polished later |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Should be fixed with #18934 |
Checklist
Describe the issue you are experiencing
I am using an IPad Pro as dashboard for HomeAssistant. After it has been running with the HomeAssistant App / Safari open for a few hours the frontend disconnects completely from the backend. Inspecting it i can see that the frontend still thinks that it has a open websocket to the HomeAssistant backend. Looking in the logs i can see that the web sockets usually has been disconnected hours ago on the backend side. I have been able to reproduce the same problem on a MacBook Pro M1 in Safari.
Now i have finally been able to reproduce the error by going out of the app and changing the wifi network. I am not sure if the device changing wifi networks in the background has been the cause of the problem the whole time or just one way to trigger it.
Describe the behavior you expected
The frontend should detect that the websocket connection to the backend is dead and create a new connection.
Steps to reproduce the issue
IPad with HomeAssistant accessed over local network:
What version of Home Assistant Core has the issue?
Home Assistant 2023.7.1
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Safari/605.1.15
Which operating system are you using to run this browser?
IPadOS 16.6
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
Inspecting the websocket connection when problem occurs. (Look at the timestamps)
https://pasteboard.co/JEbFwovEslEm.png
The text was updated successfully, but these errors were encountered: