-
Notifications
You must be signed in to change notification settings - Fork 72
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
Animation when in TEDAPI (and solar only?) mode does not load when multiple tabs are used #585
Comments
Is this only for PW_STYLE=solar ? I see this for all settings on the Chrome browser on any OS - it only ever allows one tab to render the animation. It seems to be the way it handles iFrames (security related?). Some browsers don't have a problem displaying multiple copies (tabs). Here is what I have learned from my tests (MacOS):
As a note, here is the html with the iframe using the http://localhost:8675/example.html URL - It is similar to the html used in the Powerwall Dashboard grafana panel: <!DOCTYPE html>
<html>
<head>
<title>pyPowerwall Proxy iFrame Example</title>
</head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<body style="text-align: center; background-color:#111217;">
<h1 style="color:white;font-family:verdana;">Tesla Powerwall Power Flows</h1>
<h2 style="color:gray;font-family:verdana;">iFrame Example</h2>
<!-- change src to be the address of you pyPowerwall host address -->
<iframe id="frame" src="[/](http://10.0.1.26:8675/)" width="500" height="300" frameBorder="0">
IFRAME not supported by browser.
</iframe>
<p class="version" style="color:gray;font-family:verdana;">Firmware</p>
</body>
<script>
// Get Firmware Version
function showversion() {
var pwver = window.location.protocol + "//" + window.location.hostname + ":8675/version";
$.getJSON(pwver, function(data) {
var text = `Firmware: ${data.version}`;
$(".version").html(text);
});
setTimeout(showversion, 10000);
}
showversion();
</script>
</html>
` |
It's been a long standing (and unimportant) issue for me. Just adding this for info in case it gets further work - mostly because my symptoms suggest something not so good happening under the hood. On Windows, PW_STYLE=grafana_dark. On Firefox: first tab is fine, second shows the whiteout. If I refresh either tab, the tab I refresh gets whited out and the other starts working. (really!) On Chrome: first tab is fine, second tab is whiteout. If I refresh the first tab, both start working correctly. If I refresh the second tab, the second tab goes back to white out. |
I've reproduced this on Firefox, Safari, and Chrome. It doesn't seem to make a difference. I'm not sure there's an iFrame security related issue here, I think it's a deadlock issue related to something in app.js -- Some of the endpoints like sitemaster are being called and the app.js code is running, but not ALL of it is running. I had originally suspected this had to do with the fact that the api locks in the pypowerwall TEDAPI module were not thread-aware mutexes, but I have a fix for that (coming soon) and it didn't seem to help. |
Yes, this predates TEDAPI and was happening when we were just proxying the animation direct from the Powerwall portal before it was removed. |
To clarify and summarize so far: This is neither TEDAPI nor solar.js specific. It also is a known issue going back years. I think a fix here is possible, we just need some JavaScript experts who spelunk in app.js and figure out where the lock is and make it more multi-tab friendly. This may also be cookie related as I think it always works in incognito mode + regular mode (I will check that later) For me, the primary symptom was at first I thought it wasn't working at all. |
Problem
The animation in the Powerwall Dashboard sometimes doesn't load if you have multiple copies of it open on multiple tabs in the same browser.
To Reproduce
This can be reproduced using
/
orexample.html
as well.Screenshots
Host System
Additional context
I'm nearly certain this has something to do with app.js deadlocking on a shared context object. Perhaps someone who has more expertise in webdev/JS can help investigate here? I tried renaming webpackjsonp, but that did nothing.
Other options might be to update to the latest version from the Tesla app. Nearly certain the "root" problem is this was not designed to be loaded in a normal browser, and definitely not designed to be loaded more than once!
While I reproduced this using TEDAPI/local mode and solar only, I don't believe this bug to be exclusive to that.
The text was updated successfully, but these errors were encountered: