Closed andrey-utkin closed 3 months ago
I have managed to recreate this bug, looking into it now
The commit which causes the troublesome redirect is https://github.com/bluecherrydvr/bluecherry-apps/commit/3c510b24a067291b1764d0741cdbe69f9d4a6599 . Let's refer to it as "historical commit".
The historical bugreport and the discussion which led to that patch is https://github.com/bluecherrydvr/bluecherry-apps/issues/474
Jahleel's work in progress is on a branch https://github.com/bluecherrydvr/bluecherry-apps/tree/bug/654-redirect-to-stats.php-on-disconnect
Jahleel's solution takes defensive approach which is appropriate if we are concerned about the reappearance of the historical issue.
My personal opinion is that the historical commit is just bad and should be reverted as the first step. Let's see if the original issue reoccurs - uBlockOrigin is a moving target and it might have changed its behaviour. The very idea of redirect if a request failed strikes me as odd, so if we need to fix the historical issue somehow, I'd rather we solve it differently. But I doubt the old issue would even be observed.
A browser tab with Bluecherry web UI would by itself jump to ...:7001/ajax/stats.php and present an odd "XML error" screen.
So this XML thing happens after the browser is disconnected from the internet (so that background webpage update request fails) and then is connected again:
The JS code backtrace begins at the line added here: https://github.com/bluecherrydvr/bluecherry-apps/commit/3c510b24a067291b1764d0741cdbe69f9d4a6599 https://github.com/bluecherrydvr/bluecherry-apps/issues/474