1
SVG rotation stops working after 12-24 hours
complete
C
Chris Ice
I have a weather console app where I use the SVG component to display wind direction. I get websocket updates and update the app variable from within javascript to show wind direction.
This works great, but over a 12-24 hour period, the svg rotation just stops working. Stopping and restarting the app resolves the issue, for a while.
Debugger shows no console error messages, but app variable does show that I am getting direction changes and it should be updating the svg.
Happens when running in either preview (4.2.9) or standalone (3.4.10) mode.
Appid: 182658
Page: 1
SVG component ID: 3e8f58ac-5476-4141-9b3a-d8eb4b33f02f
Settings not required - app should start updating shortly after it's opened.
Log In
T
Timo Kapanen
complete
C
Chris Ice
Timo Kapanen: following up on this and just to close out this old issue; but pretty sure I figured it out. In my websocket implementation, I mistakenly had multiple and redundant websockets open. This was causing me to get duplicated, concurrent updates to my page variable, which was in turn tied to the rotation angle of the svg. I can only suspect that some sort of race condition was happening inside the svg component eventually and was causing the rotation to stop while other display updates were working fine. Visibly, I couldn't see the change in the UI, and even in the debugger console. Its only when I looked at the adb debug that I could see multiple, redundant messages coming in. I've since eliminated the duplicate websocket problem, and the svg rotation has been working continuously for now several days without restart.
C
Chris Ice
So I'm embarrassed to say that, after chasing this for nearly a year, this problem hasn't re-occurred since opening this bug report nearly a week ago.
I think what may be happening here is, because I'm getting data from a websocket json and populating an untyped custom-object app variable, perhaps I am getting an occasional bad value (ie. NaN) in the ws message. Because it is not-typed, somehow this is causing the svg rotation to fail unrecoverably bringing the need to stop/restart the app to restore function.
I have no evidence that this is the case because I'm getting a ws message very few seconds and do not have a running log of all messages. However the issue does not appear to be a time-based failure (or a memory-leak type failure) given the app is running now for a week with no problem, and that perhaps it is the external data.
I am also unable to reproduce the issue with my image rotation test-app no matter the time, and will note that it keeps the randomly-generated rotation angle in a typed variable (number).
Possibly then the only action here is to error-handle svg rotation when unexpected data comes in the dynamic value.
Hope this helps.
T
Timo Kapanen
Chris Ice: thanks for the update. We'll see going forward if some error handling could be added here. Best Regards, Timo Kapanen
C
Chris Ice
Timo Kapanen: Of course it is now back again, but I simply cannot reliably reproduce. So if there's any additional debug I can provide, pls let me know. Otherwise, more error handling is probably the next best thing, esp in tracing where this is coming from. Thanks again.
T
Timo Kapanen
Chris Ice: we'll look how to make the product more robust regarding to this matter. If there was more info what triggers the issue ('sample bad data'), that would greatly help.
C
Chris Ice
Timo Kapanen: is there any way to send console output to a file on the device? Because the app has to run for a long time, the debugger eventually disconnects and I lose the console output. If I can send it to a file, I would have that to look through when I notice that it's stopped working.
T
Timo Kapanen
under review
T
Timo Kapanen
Hi Chris Ice and thanks for your report. This issue is under study. Best Regards, Timo Kapanen
C
Chris Ice
Timo Kapanen: Don't know if it helps, but I have a test version which just uses random numbers to rotate the same svg instead of the websocket. I've not yet observed the problem on this build, but wanted to make you aware of its existence.
C
Chris Ice
I know that the app variable is updating because I can watch it change in the client debugger while the svg in the app itself no longer rotates. Other app data in the UI is updating from the websocket as well (wind speed, for example) and that comes in the same websocket message as direction.