-
Notifications
You must be signed in to change notification settings - Fork 179
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
MSE: fix sign_path call for compatiblity with 2022.7 #320
Conversation
Since home-assistant/core#73829 was merged, HA now requires that full path including the query parameters is signed. Prior to this commit, the parameters were not included and this resulted in the websocket setup failures due to JWT token being invalid. This commit resolves AlexxIT#318 for me, although I have not tested this on any older HA instances as I don't have access to any.
Thank you, working! |
#320 does not fix for me |
@Claudio1L make sure that you that the old javascript is not cached. This means:
This process will not be needed if this gets merged and new version is released. |
@skrobul Thanks a lot!! The camera feed has been shown again! I rewrote the "version" in manifest.json to "v2.3.0.1" to ensure a js reload and then restarted HA. EDITED: Changed to "v2.3.0.1" instead of "v2.3.1" so that it will not be the same as future versions. |
looks like a fix for version 2022.7 but the the code changes do not appear to be backwards compatible. the js patch breaks functionality in 2022.6 |
Yeah, that's what I was afraid of - thanks for checking this. When I get some spare time, I will have a look to see if this can be adjusted to detect versions. |
Would be best, although I'm not a fan of carrying backwards code forward indefinitely, it's early to make a break. I tried 2022.7, saw broken camera views and was super excited to see your fix, but an important camera lux sensor I wrote broke in 2022.7 due to a opencv library issue related to python 3.10 and decided to rollback to 2022.6 |
@markfrancisonly added version check in 8f05746 - can you try it when you get a spare moment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested that changes create backwards compatibility to 2022.6
This fix didn't work for me. I even deleted webrtc and upload all files again with a restart. Don't have the webrtc-camera.js.gz file. |
Does your browser see updated If you DO see the updated code, but it still does not work then please let me know if there is anything showing up on your javascript console. Also, make sure that you have the |
Its working now! It didnt auto updated the webrtc-camera.js file when I checked with inspection on Google Chrome. |
Awesome, I've updated the instructions with that - hopefully the steps are correct - don't have any iDevices to test on. |
It worked! thanks! It was hard to get rid of the cache for some reason. After logging again into HA, WebRTC worked! |
Perfect shot! |
So, any news on merging it into master so that people can start updating? |
It looks like the backward compatibility check breaks the create_link service. From debug tools in the browser, we see this now. Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'haVersion') |
where do I get the updated webrtc-camera.js file? I didn't see any difference on the one I could download here from the one I am using. also I can't see the "let unsignedPath" entry in my file.. |
Look in this thread (scroll up) under the section commits. There you will see which lines are deleted and added. You can also edit your file insteed of copy the file. |
perfect, thanks for the hint, I have changed the file now and everything
seems to be fine now!
|
then
|
@skrobul I've came from each point release. I am on 2022.7.3 now but came from the 2022.6 series. I can try that change... EDIT: That worked in chrome for me. I'll test it in my other clients like pipup and others as well. thanks! |
Thanks! |
@AlexxIT can you make a new release? so all users get this patch automaticly |
I rewrote the authorization check on the server side. This is better than check the HA version on the client. const needsParameterSigning = (hass.connection && hass.connection.haVersion >= '2022.7.0b0');
"2022.7.0" >= "2022.7.0b0" // false
"2022.10.0" >= "2022.7.0b0" // false |
Since home-assistant/core#73829 was merged, HA now requires that full path including the query parameters is signed.
Prior to this commit, the parameters were not included and this resulted in the websocket setup failures due to JWT token being invalid.
This commit resolves #318 for me, although I have not tested this on any older HA instances as I don't have access to any.