TheTimeWalker / wallpanel-android

WallPanel is an Android application for Web Based Dashboards and Home Automation Platforms
https://wallpanel.xyz
Apache License 2.0
414 stars 42 forks source link

[BUG] browser gets in bad state and wont respond to http commands correctly #50

Open mogorman opened 1 year ago

mogorman commented 1 year ago

Describe the bug I have a gallery web app that I connect to with this. Occasionally it looks like a xref request fails to grab an image. When this happens the browser seems to lock up. the http api commands like brightness or settings seem to work, but relaunch , reload , and url seem to do nothing. the currentUrl never seems to update. When I first got into this state i was able to do an eval alert one time without a problem. now any time i issue it also does nothing.

To Reproduce Long running websocket with xref requests. I realize this is very connected to what I am doing so if you have suggestions on how to debug I am happy to look into it.

Smartphone (please complete the following information):

mogorman commented 1 year ago

maybe it would be possible to have last console.log be accessible as a api/state var?

mogorman commented 1 year ago

also it looks like even on a non crashed app. the alert function only works one time.

curl http://10.0.42.60:2971/api/command --header 'Content-Type: application/json;charset=UTF-8' --data-raw '{"eval": "alert(2);"}'
# clear the 2 by pressing okay
curl http://10.0.42.60:2971/api/command --header 'Content-Type: application/json;charset=UTF-8' --data-raw '{"eval": "alert(2);"}'
mogorman commented 1 year ago

url and eval also only seems to work one time and block all future commands after being called.

mogorman commented 1 year ago

relaunch and reload seems to be fine on recalls.

JavanXD commented 6 months ago

I experienced the same issue, I had to restart the WallPanel app after sending an command with "eval".

Device: NSPanel Pro

JavanXD commented 6 months ago

@TheTimeWalker could you please take a look at this BUG?

You call stopDisconnectTimer() once a eval() command is triggered which is unnecessary. The same for url() command. https://github.com/TheTimeWalker/wallpanel-android/blob/4c276ba7a2aa10240cdcf029e66c4b4695e9b20c/WallPanelApp/src/main/java/xyz/wallpanel/app/ui/activities/BaseBrowserActivity.kt#L89