Reload after upgrade #74
Replies: 6 comments 1 reply
-
I managed to solve this by redownloading latest version via HACS, to force this to pop-up: After clicking reload, I can see new styles etc. What service is that reload function calling? |
Beta Was this translation helpful? Give feedback.
-
Excellent question @alexdelprete! The more I research this issue, the more I find that there doesn't seem to be a perfect solution yet. HA's cache when it comes to .js files is very very sticky. Even using the standard browser controls to clear the browser cache doesn't always work, which can be a pain. Since I'm a developer, I have a constant need to reload the latest resource as I'm building it so I've come up with a 95% reliable way to do this in chromium. Chrome / ChromiumFirst, I open the chromium developer tools. This can be done one of three ways:
At this point, If you press F5 or click your browser's refresh button, you will see the the developer tools screen fill with information related to your page re-load. If you do not see a console window at the bottom of the developer tools, pressing the ESC key will likely toggle it back into view. In the console window, you might find some information that could be helpful for you in the future. For instance, if you ask yourself "Do I actually have Firemote version 2.1.6 installed right now?" you could find that answer in the console window: These next steps I do to ensure a full proper refresh are quite heavy handed, and it's possible that not all of these steps are required. I have found that in my setup, this seems to work almost all of the time so it's what I do. Click on the clear buttons in both the network tab and the console. Next, I hold down CTRL + ALT + SHIFT and then click the browser's reload button This seems to be the magic process that works. It may not be appropriate in every situation, but it works for me. iOS Home Assistant AppFirst, click on "Settings" in your Home Assistant App Then, select Companion App This seems to work most of the time. If it doesn't work right away, I suggest closing the Home Assistant app and re-opening it. If it's still not updated, try the above steps again. Android Home Assistant AppThis one is the trickiest for me, I usually have to repeat these steps 2 or 3 times before I get anywhere. Hopefully I will someday find a better way, but as of today this is what I do. Swipe the screen from top to bottom to access the pulldown menu. Click the gear icon to access the settings menu Next, locate and click on the Apps menu Then, scroll through your apps until you find the Home Assistant app, then click on it The App Info menu should be open, showing the details for the currently installed Home Assistant App. Find "Storage" and click on it You should now see the size of the current app cache, and a button to clear the app's cache. Click on the "Clear cache" button Here is where it gets interesting / frustrating... the screen shows that the cache has been cleared BUT... if you click back one menu, and step back into this one, you might find this The cache has quickly grown back from zero. It's nowhere near the size it was when we first got here, but it's not empty either. I'm uncertain if this behavior is the reason why it sometimes takes multiple tries, a Force Stop, or a device reboot to ultimately show me the updated content, but either way it can be very frustrating. ConclusionI wish there was a better way right now to handle this annoyance. If you (or anyone else reading this) happen to have a better solution, please share it! I did find one thread online where this problem was being discussed by people with authority, but it hasn't seen any action for several months. As far as replicating what happens when you click the RELOAD button on the Home Assistant dialog that you posted, I will need to look into that further to see if there is anything to learn from it. I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Wow Doug, I didn't want you to spend all that time writing that post. Sorry for that, but I much appreciate your kindness. Actually the method in my second post of this thread is working fine. I'd love to know what that RELOAD button is actually doing so we can come up with some script and a button in lovelace that calls it. And I know that this can be done because when I started with HA a couple of years ago, I found on the forum a lovelace card with 3 buttons, one of which was lovelace reload, that I think was doing the same thing, but at the time I felt I didn't needed, so I deleted it, and now I can't find the post with that code anymore. Anyway, for me the simplest solution when upgrading will be to redownload firemote and hit reload after the installation, when asked to do so. :) Thanks again, you are a very kind person, and thanks for your work. |
Beta Was this translation helpful? Give feedback.
-
I wasn't sure how much you wanted to know. 😄 Is this the integration you were talking about? https://github.com/mathoudebine/homeassistant-browser-control-card |
Beta Was this translation helpful? Give feedback.
-
No it was some custom code a user posted of his card, and there were these 3 buttons. |
Beta Was this translation helpful? Give feedback.
-
@alexdelprete ~ Fun fact: I took this thread and made it into a Firemote Wiki article called Force a Refresh, and it has become one of the most popular pages on the Wiki. We are not alone! 😄 |
Beta Was this translation helpful? Give feedback.
-
@PRProd Hi Doug,
every time I upgrade Firemote, and I want to try new functionalities, I don't see them because the frontend is probably caching the resources. I even tried restarting HA but it doesn't help (really strange).
Obviously I tried hard-refresh of the browser but it didn't help.
What is the correct procedure after upgrades to make sure HA is loading latest resources?
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions