Android: Pull to Refresh

Created on 18 Nov 2019  路  7Comments  路  Source: home-assistant/android

The Home Assistant PWA, when used in Chrome for Android, supports pull to refresh. I frequently use this to get Home Assistant working again when it loses its connection to the server. It would be nice if the Android app had this feature too.

enhancement webview

Most helpful comment

@balloob I would say about 80% of the time it is within 1 second. The other 20% it can be up to 3-5 seconds for the frontend to connect. In some extreme cases (even when I am home) it can take up to 20-30 seconds or even longer. Refreshing the window/app makes it load 100x faster in these cases. I am not sure what logs to pull for this but its definitely not as consistent as you say. I notice this most often in Chrome when I keep the tab open and load the app on my phone. Desktop does not have this issue.

All 7 comments

I would like to see this as well, pull to refresh in chrome allows the site to load faster instead of waiting for it to connect again. Sometimes that connection can be really slow for HA when you keep the tab open and it tries to update on its own, refreshing the page is much faster. Not sure they will add it due to: https://github.com/home-assistant/home-assistant-android/pull/18

Home Assistant should automatically reconnect with a maximum of 1 second delay. If something there gets stuck, we should fix that. Maybe force a reconnect by pressing the toast ?

We should fix things and I consider this a workaround.

@balloob Agreed. Pull to refresh is a workaround for a larger issue.

The larger issue is that the app often fails to reconnect. Whenever I return to the app after it is in the background for a while, a black bar appears at the bottom saying "Connection lost. Reconnecting..." and it definitely takes longer than 1 second to reconnect, if it reconnects at all. I usually have to manually exit the app and restart it to get it to connect.

BTW there was a PR open for that, but it got closed:
https://github.com/home-assistant/home-assistant-android/pull/18

So until the things are fixed in the frontend, I would really welcome the workaround. When it's not needed anymore, we can remove the workaround again.

@balloob I would say about 80% of the time it is within 1 second. The other 20% it can be up to 3-5 seconds for the frontend to connect. In some extreme cases (even when I am home) it can take up to 20-30 seconds or even longer. Refreshing the window/app makes it load 100x faster in these cases. I am not sure what logs to pull for this but its definitely not as consistent as you say. I notice this most often in Chrome when I keep the tab open and load the app on my phone. Desktop does not have this issue.

I also encounter this problem when in example some icons/images don't load. Only way to refresh them is to kill app, as there's no way to reload interface (and they won't load themselves too)

Will close this as we shouldn't implement it as is. I suggest that any bugs like delayed reconnect are reported to the frontend team.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aleksandrov1995 picture aleksandrov1995  路  4Comments

rradar picture rradar  路  4Comments

Knoxie picture Knoxie  路  5Comments

simbesh picture simbesh  路  3Comments

AndrewDaws picture AndrewDaws  路  4Comments