trame/synchronization_context/get_cached_data_array key not found after on_client_connected callback #677
-
Issue solvedI used
but should be
for async functions. Then, I used both to enable 'remote rendering', but should be only use one of them.
after test, I found out only this worked for me.
Really appreciate the help and time from jourdain Hi guys, Could anyone give me some suggestions on this error code? Here is the code I am using to refresh the plot.
Here is the error code from terminal
As I mentioned above, the error comes out when the plot gets refreshed. The tricky thing is this error does not affect the frontend rendering. I feel like the code was trying to read some expired data, like backend and frontend are not sync. Tried to add some time.sleep() to give the server to load the data. But didnt help. Please give me some suggestions. Thanks you guys. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
What you are describing is indeed correct and reflect what is happening. You should be able to fix that by doing the following async def on_client_connected():
await asyncio.sleep(1)
if yes:
with state:
plotter.clear()
plotter.add_mesh()
plotter.reset_camera()
ctrl.view_update()
ctrl.on_client_connected.add_task(on_client_connected) |
Beta Was this translation helpful? Give feedback.
-
pv.set_jupyter_backend('server') # one or the other
view = plotter_ui(self.plotter, mode="server")# one or the other |
Beta Was this translation helpful? Give feedback.
What you are describing is indeed correct and reflect what is happening.
You should be able to fix that by doing the following