home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.07k stars 587 forks source link

Fix popup for reconnecting to the server #4358

Open Roffild opened 4 weeks ago

Roffild commented 4 weeks ago

After receiving an ERROR, the page must be reloaded.

WebView cannot report an error from the server.

Closed #4272

home-assistant[bot] commented 1 week ago

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

Roffild commented 1 week ago

Full fix for: https://github.com/Roffild/roffild.github.io/assets/38705255/2e049aea-bc77-482c-8355-d03e22345464

jpelgrom commented 1 week ago

Full fix for: https://github.com/Roffild/roffild.github.io/assets/38705255/2e049aea-bc77-482c-8355-d03e22345464

This still doesn't describe the issue (when down an error is expected, and the refresh button refreshes) and also doesn't match the code changes which are all over the place. Trying hard to find something here but if we cannot agree on an issue and the value of changes, maybe this should be rejected.

Roffild commented 6 days ago

showError() gives a choice to the user. But this choice doesn't know about the WebView's status.

Open http://hass.example.com in your browser. You will get an error. WebView doesn't autoReload. Will you WAIT endlessly (do nothing)? Or do you use page reload (F5)?

webView.reload() always reloads the page.

this.reloadPage() waits for the page to load or for an error.