FIX Improve robustness of attribute query for JSProxy#456
FIX Improve robustness of attribute query for JSProxy#456mvdoc merged 22 commits intogallantlab:mainfrom
JSProxy#456Conversation
|
From my reading of the code, pycortex/cortex/webgl/serve.py Lines 324 to 334 in 908cc80 |
Oh right, I missed that for some reason, thanks! |
…bglview * 'fix/webglview' of github.com:mvdoc/pycortex: Increase wait time MNT remove unused code FIX avoid querying too many times Missed one line ENH try to add waiting time directly to JSProxy FIX reuse the surface obj FIX deal with keyerror in how __getattr__ is defined FIX generalize how to get an attr from self.ui Better print message Attempt to fix JS UI errors FIX update nibabel deprecated methods (gallantlab#457)
|
Unfortunately, the viewer still crashes from time to time. It seems to me that 10s should be enough time to wait, so maybe the problem is somewhere else. :\ |
|
Does it crash after the 10sec wait? |
|
Yep, it crashes with the same error: ( |
|
This new change I implemented seems to have solved the problem (🤞). I made a new property for |
attr from JSProxy objects for a max of 10s before failing JSProxy
Functions like
code.export.plot_panelsfail from time to time in an unpredictable way. It looks like the culprit is that theJSProxyobject tries to get some attributes that do not exist yet (see #449). However, when inspecting the JavaScript console, those attributes do exist. This suggests that the querying process is not robust enough to random delays in updating the viewer/JS environment.This PR adds a simple logic that queries for the desired attr up to 10s before giving up. It should make the querying process a bit more robust.
Closes #449 (hopefully for good)