AnthonMS / my-cards

Bundle of my custom Lovelace cards for Home Assistant. Includes: my-slider, my-slider-v2, my-button
Other
104 stars 27 forks source link

after last 3f117b2 version Home Assistant GUI goes crazy #25

Closed liuk4friends closed 2 years ago

liuk4friends commented 2 years ago

description:

After installing the latest version, the Home Assistant GUI does not work well. Several pages no longer open. For example that of the profile and some settings pages. The apexcharts frontend no longer works and its cards are no longer displayed (many errors appear). Some view icons are zoomed out and all squeezed to the left (I'm using the Lovelace UI Minimalist interface).

how to solve:

I had to uninstall my-cards in order to regain control of Home Assistant. Among other things I would like to try to re-install the previous version of my-card but through HACS I can't.

other information:

What version of my-cards has the issue? 3f117b2

What was the last working version of my-cards? last two previous version

What type of installation are you running? Home Assistant OS

additional information:

hardware: Rpi4b Home Assistant Core 2022.6.7 Home Assistant Supervisor 2022.05.3 Home Assistant OS 8.2

AnthonMS commented 2 years ago

Hmm, weird. I haven't seen any weird behavior since starting working on these changes. I shouldn't have done anything that should screw anymore with the rest of Home Assistant, than I already did.

I make sure to turn off development, build and upload the build to my local HA Plugins folder and then I restart HA using the newly build card. If everything seems to work as they should, then I push the code.

I don't really know how to debug this. I'm sorry.

I should mention that I am very much behind on updating HA since I heard many horror stories about deprecated integrations. So I am actually about a year behind by now. I hope this is not the cause of the error. Hopefully it will be resolved and I won't wake up to a thread full of angry users.

Home Assistant Core 2021.6.6 Home Assistant Supervisor 2022.05.3 Home Assistant OS 6.1 (Newest 6.6?)

Edit: Oh shoot. I see it now. Is it this you are talking about?: Removed img

I'm so sorry. I thought I had tested it properly. But the card works as it should. Just not the rest of HA? I don't know. I'm a bit too tired to look into this too much right now. I will figure it out.

Edit 2: It's back to normal for me now after writing that other update. I don't know what is happening?

herveaurel commented 2 years ago

I have exactly the same problems! I no longer have the brightness bar in the HA popups, the pages do not refresh, I have difficulty with the tap action, the graphics are in error.

herveaurel commented 2 years ago

it is a disaster ! can you put back the old version please!

liuk4friends commented 2 years ago

hi @AnthonMS, first of all thank you for your hard work.... What about putting online the previous versions of your code? This is very helpful in this situations 'cause we can easily revert to the functioning version without removing your code and without stressing you with a lot of requests ...

herveaurel commented 2 years ago

Can you offer previous versions so that we can downgrade? For other hacs integrations, there is this very handy option. HA is a disaster on a lot of things now. Thanks a lot

AnthonMS commented 2 years ago

There is a reason I haven't actively put this in HACS and why it took so long for me to add it to the readme. Because I was not really interested in people just hitting an update button with their head under their arm.

I have build a version where it is only the old slider card that is in it. That is the latest version up. So update to that. I haven't changed any code in that card anyway because it's uselessly complicated and not worth trying to save.

I agree it would be nice with the releases feature. I have thought about it, but I seriously haven't had time for anything regarding this card. So when I have time, I really don't want to spend it to set up features I don't get any benefits from.

AnthonMS commented 2 years ago

It must be because of some lovelace template theme you guys are using? Or are you using the slider card directly in your lovelace yaml or UI configuration?

I don't know what it is. If you guys update to the latest version and it's still happening, then it is very limited what I can do. Because I have not worked on the my-slider. So the code should be identical to what you where using yesterday and 3 months ago.

herveaurel commented 2 years ago

OK, thanks. I'm waiting for an update that fixes the HA status. Please try to be quick if possible. Thanks for the work.

herveaurel commented 2 years ago

It must be because of some lovelace template theme you guys are using? Or are you using the slider card directly in your lovelace yaml or UI configuration?

I don't know what it is. If you guys update to the latest version and it's still happening, then it is very limited what I can do. Because I have not worked on the my-slider. So the code should be identical to what you where using yesterday and 3 months ago.

In the card directly. And there are bugs everywhere since the last update.

AnthonMS commented 2 years ago

There's nothing more to be done from my side. You just have to wait for HACS.

Let me know on your next update.

If it persists, then tough luck I guess.

herveaurel commented 2 years ago

3f117b2 : since this version I have a lot of problem

herveaurel commented 2 years ago

There's nothing more to be done from my side. You just have to wait for HACS.

Let me know on your next update.

If it persists, then tough luck I guess.

OK. did you upload a version other than 3f117b2?

AnthonMS commented 2 years ago

3f117b2 : since this version I have a lot of problem

Okay, and you're sure it worked on version d90c374?

If the next update works, but it comes back. Then the only way I will be able to fix it, is if you actually provide some logs or some kind of documentation of what kind of bugs and what happens exactly. This "I have a lot of problem" will not get you anywhere. As long as I am not seeing these problems, then I cannot fix them.

I will go to bed now. Just be patient and wait.

herveaurel commented 2 years ago

No I'm not sure, but it seems to me that before 3f117b2 everything was working fine. Yes, I will try to provide as much information as possible. But there are a lot of things that don't work or work badly. Thank you for your efforts. And good night, I'm going to bed too.

liuk4friends commented 2 years ago

I'm sorry to bother you again. I tried to re-install my-cards but the problems I described to you reappear. Maybe we need to wait some time before trying to install the new 5fc50e4 version? Could it be that the GitHub servers still have the old version?

However, I have prepared a couple of screenshots for you to see. This is the error with apexcharts card: Screeny Shot 1 Jul 2022 at 00 29 16

And these are the icons on the top the page that don't work anymore: Screeny Shot 1 Jul 2022 at 00 30 25

Don't worry and go to sleep now. I'm going to bed too. We will wait patiently. After all, we are the ones who benefit from your time and efforts. Thanks again and good night

Edit: 5fc50e4 version is working right now .... Now I'm really going to bed ....

herveaurel commented 2 years ago

I got the update and apparently there is no more problem! A big thank-you

AnthonMS commented 2 years ago

The new version should fix this. Because now I know exactly what it is. I have made a custom deflate function and inject it into the Object prototype. And I can see it is complaining about some deflate stuff.

I have actually made a local deflate function as well, which I will just use in the future so hopefully this won't happen again.

Apparently I'm just not using any of the same cards as a lot od you guys. So I haven't seen this error.

I am sorry for any inconveniences this has caused and it should be fixed in the latest commit since I'm not building the new card that are creating the deflate function.

Goodnight and hope you guys sleep well :)

AnthonMS commented 2 years ago

I got the update and apparently there is no more problem! A big thank-you

Sorry about the inconvenience and thank you for the screenshots. It tells me exactly what I needed so the error won't come back.

Sorry for being a bit blunt in the way I said it. But I really didn't know what errors it was and I got a bit stressed because I didn't want to go to bed while it wasn't working.

But thank the lords that it was an easy fix. Now I can sleep peacefully.

herveaurel commented 2 years ago

you are a genius. thank you !

herveaurel commented 2 years ago

Do not apologize ! You are the master, and a genius!

AnthonMS commented 2 years ago

Do not apologize ! You are the master, and a genius!

Lol thanks, but I was also the one to cause the mistake in the first place. So I am both a moron and a genius.

Kidding aside. Thanks for letting me know about it so quickly, so more people didn't have to experience any downtime. I have renamed my injected function to be pretty specific to my cards. Hopefully it won't interfere with the deflate function other cards and/or HA has injected with the same namespace.

Hope you guys are enjoying the card even though I have no idea how to maintain an open source repo and break it all the time.

I will be releasing the my-slider-v2 card very soon. And I must say, that it's looking very promising. Now I haven't done a very extensive cross browser test. But if it works everywhere as it does in chrome, then it's working exactly like the old one, except for being 100x more customizable and easily made vertical, flipped or any other feature one would like. Hopefully people will enjoy that even more than this, and the code has been right from the beginning, instead of being released as spaghetti code and impossible to update without breaking something.

And thanks for the screenshots @liuk4friends. If it really is the deflate, then these images has saved me a lot of time debugging.

herveaurel commented 2 years ago

I'm a huge fan of your work and use it a lot on my dashboard which I write entirely. Cheer !

It's me here : https://github.com/herveaurel/HomeAssistant

AnthonMS commented 2 years ago

I'm a huge fan of your work and use it a lot on my dashboard which I write entirely. Cheer !

It's me here : https://github.com/herveaurel/HomeAssistant

Oh that's cool. I see a lot of people use your dashboard. Which means more people use this card than I expected.

As I said, the old slider won't get any more updates. Since I'm working on the v2 which will be build entirely differently. It does not use the crappy browser range input slider. I have written my own slider from scratch with html elements. But the old slider will not be affected in any way. Just use the new card 'my-slider-v2' when ready to upgrade and set up your sliders with the new and improved slider :)

It is not in the current bundle since the bug from last night. But the bug should be fixed and the card should be back in the next version.

herveaurel commented 2 years ago

I can't wait to try your new version! And to include it in my dashboard! How will I be informed of the new version v2?

herveaurel commented 2 years ago

I just got update 962e579, which starts bugging everything again in HA. Fortunately I made an HA backup before, which I will put back right away…

AnthonMS commented 2 years ago

I just got update 962e579, which starts bugging everything again in HA. Fortunately I made an HA backup before, which I will put back right away…

Is it the same bug? Does the apex charts card says the same error as the screenshots from yesterday?

If you can, then it would be nice if you could try the latest version 4cab27a This does not contain the slider-v2. Which has to be the one causing issues. If it is, then I have to dive deeper into it. But I will probably just start by removing the injected code all together.

The coming update will be with the new card included. It is not bugging for me. I will of course fix the bug the best I can with the documentation I get provided from you guys. I am pretty sure it was te injected code. Everything like that is removed and made to be contained within the new card, like it should have been from the beginning, I admit. If it still messes up Home Assistant for you, then provide some logs or something o I can try to figure out why.

herveaurel commented 2 years ago

I saw the same thing quickly. I quickly restored!

AnthonMS commented 2 years ago

I saw the same thing quickly. I quickly restored!

Does it happen with this version 5cbec9b ??

And as I said. As long as you don't show me, then I can't fix it. The coming updates will cause this bug for some people apparently. I will fix it when someone comes along providing details into it, since I can not duplicate it locally. I recommend not updating if you're not willing to provide information on the bug that is happening for you. The deflate bug should be fixed now. If not please let me know @liuk4friends.

herveaurel commented 2 years ago

I do not know. Currently I have 5fc50e4. I can test 4cab27a if you want.

AnthonMS commented 2 years ago

I do not know. Currently I have 5fc50e4. I can test 4cab27a if you want.

4cab27a is build with the old slider card and 2 other cards that I use personally and haven't publicly released yet. They have been a part of the build for about a week at least by now. But I might be mistaken about that.

Version 5cbec9b is build without those 2 cards but with the old and new slider cards.

If this bug happens on one, both or either of them. Please let me know the outcome and if it bugs out, can I get you to open the developer console, refresh the page and take a screenshot? That might be able to help.

And please clear your cache and everything in between tests.

liuk4friends commented 2 years ago

I saw the same thing quickly. I quickly restored!

Does it happen with this version 5cbec9b ??

And as I said. As long as you don't show me, then I can't fix it. The coming updates will cause this bug for some people apparently. I will fix it when someone comes along providing details into it, since I can not duplicate it locally. I recommend not updating if you're not willing to provide information on the bug that is happening for you. The deflate bug should be fixed now. If not please let me know @liuk4friends.

hi @AnthonMS, as I wrote yesterday night 5fc50e4 version seems good to me. Apexcharts cards are working e HA GUI seems operational as usual ... How can I be more helpful?

AnthonMS commented 2 years ago

How can I be more helpful?

You have been very helpful already. My comment was not directed towards you. Sorry about that.

The version you are using is also the build where it is only the old card that has been build into it.

Version 5cbec9b is the latest version and it contains both the old and new slider card in the build. If this is still causing issues, then I know it is the new slider card at least.

If that version works, can you try version 4cab27a? This version is without the new slider card, but with 2 other new button cards that I am playing around with in my own setup.

If all versions work. Then I will close this issue, because then your bug has been resolved and @herveaurel can create a new issue asking to resolve his problem without spamming you @liuk4friends with progress on that. :)

liuk4friends commented 2 years ago

Ok I could try the last one, 5cbec9b , and, If something goes wrong, I could delete it (before deleting it, I could take some screenshot). Then, how I could try 4cab27a? I should manually copy the file '/dist/my-card.js' inside '/config/www/community/my-cards/' folder, overwriting the existing one?

AnthonMS commented 2 years ago

Then, how I could try 4cab27a?

Oh I thought it was somehow possible to to update to specific commits when releases isn't implemented. When you have tried that, I can push the build so you can update to that. And finally i can push a commit with only the only slider card in it again that will be up as the latest version for some hours. If everything fails, be careful updating later or tomorrow, since it could bring this bug fourth again.

liuk4friends commented 2 years ago

I wonder if a manual update and browser cache refreshing could work, without pushing a commit....

AnthonMS commented 2 years ago

I wonder if a manual update and browser cache refreshing could work, without pushing a commit....

It might. The code I injected originally might be cached somewhere, somehow. I have tried testing if it's still present in my browser, and I can not trigger a function under Object.prototype named deflate() anymore. Or I can, but it does not recognize it as a function on my end.

If you go to the developer console and paste in this command Object.prototype.deflate(), does it return this: image Or does it return something else? Can you screenshot output? And what is the output if you put something like this Object.prototype.myDeflate()?

This is an example of what the return looks like if the function exists. NOTE: The function myDeflate should NOT exist on your end, if it does, then it's a caching issue. image

liuk4friends commented 2 years ago

Ok this is the result of Object.prototype.deflate() Screeny Shot 1 Jul 2022 at 15 56 38

Safari 15.5 my-cards 5fc50e4

AnthonMS commented 2 years ago

Ok this is the result of Object.prototype.deflate() Screeny Shot 1 Jul 2022 at 15 56 38

Safari 15.5 my-cards 5fc50e4

I should probably mention, you have to test this while being on your Home Assistant page. Then open developer console on that and try the command. The command will not be injected by anyone if you're not on the page where it is being injected. So try on a page where there are Apex charts as well as without if possible. And same with latest version of this card where the card is present and not.

liuk4friends commented 2 years ago

Ok got it. Safari 15.5 my-cards 5fc50e4

page with Apexcharts card: Screeny Shot 1 Jul 2022 at 16 17 50

other page (HA home page): Screeny Shot 1 Jul 2022 at 16 20 27

AnthonMS commented 2 years ago

Perfect, thank you. I can definitely say with pretty good confident, that the error you experienced was because apex charts and the new my-slider-v2 was imported on the same page. I can see they inject a function into the object prototype named deflate. I did as well.

Your error has been fixed. I'm sorry that it happened. If it keeps happening with the next version I release in a moment, then it has to be a cache problem or something. Or there are more to the bug than catches the eye. And then I would need some more help debugging.

I will also in my next code push, include some different build files in the dist folder. These will not be tempered with on regular commits and they will be pretty static. They will be individual cards.

liuk4friends commented 2 years ago

Ok, should I try the other two versions as you asked me before?

AnthonMS commented 2 years ago

Ok, should I try the other two versions as you asked me before?

I will push a version in a moment that you can try. If it still gives problems, let me know. But There will also be a new script in the dist directory called 'my-slider.js'. This will only include the old slider and shouldn't give any problems ever.

AnthonMS commented 2 years ago

Ok, should I try the other two versions as you asked me before?

I have just pushed a new version. This includes only my-slider and my-slider-v2.

If this gives problems, please let me know and I will try to see if I can figure out what happens.

If you don't want to deal with this anymore, then I have created a static my-slider.js script and put it in the dist dir.

liuk4friends commented 2 years ago

So I've installed your last version c6ff7dd

I've rebooted HA, then I've cleared the browser cache. It seems to me that it is working fine. I've noticed some glitch reading my HA's media page but after a page refresh all seems working.

Below you can find two screenshots: one of my system (apexchart) page Screeny Shot 1 Jul 2022 at 16 51 01

and one of my media page Screeny Shot 1 Jul 2022 at 16 52 32

Some error here and I don't know why. There is no apexchart card in my media page...

Edit: those (apexchart related) errors appear when I move from my system page (apexchart empowered) to another page (any page)

AnthonMS commented 2 years ago

The apexchart related error, I unfortunately can not help you with. They seem to be some underlying error in that card. I do not use apexcharts.

But I am happy to hear that everything else seem to work. That indicates to me that it was either a caching issue after I initially resolved the error. Or it is an error in one of the other my-button cards that are not included in this current build.

If it comes back after I add the other cards again, please let me know right away. But until further notice, then I would say this issue has been resolved and I will close it. You should be able to comment on it further and I will still see them and react to them, if the issue persists.

Thank you so much for your help! :)

herveaurel commented 2 years ago

hello. sorry I was away. the bc8f810 version works correctly? thank you

AnthonMS commented 2 years ago

hello. sorry I was away. the bc8f810 version works correctly? thank you

It has been working correctly since at least e7288ee where I removed all global deflate references completely. But I am happy to hear that it is working as intended again. btw. I have updated the readme to include some documentation for the new slider. If you feel like it, then please play around with it and let me know if you find any bugs. Just create a separate issue.

Thank you.