-
Notifications
You must be signed in to change notification settings - Fork 267
add_instance_to_interface improvement: sending a response via websockets after just shutting down/restarting doesn't work #2172
Comments
I think Holoscape works around this by just refreshing a whole browser client page, but that is a very non-ideal solution |
Wondering why the interface has to be restarted anywway,
|
@AshantiMutinta thanks :) I am looking closer into it. The issue, (why it needs to restart the interface), is because the interface JSON-RPC calls are statically defined during interface start up, versus dynamically checked during JSON-RPC calls...
holochain-rust/crates/conductor_lib/src/interface.rs Lines 205 to 215 in 9564458
Notice how the instances are stored as a hard reference outside of the JSON-RPC call. |
holochain-rust/crates/conductor_lib/src/interface.rs
Lines 664 to 676 in 9564458
add_instance_to_interface causes clients of the interface who called this function to lose their connection, and thus lose their response to their call. I wonder whether you could add_instance_to_interface, send response, then restart interface outside of add_instance_to_interface instead?
for context, I am dealing with this here, and you will notice I have to do some pretty major workarounding
https://github.com/h-be/acorn-ui/blob/master/src/routes/Dashboard/Dashboard.js#L195-L228
This is where, within add_instance_to_interface, it restarts the interface
holochain-rust/crates/conductor_lib/src/conductor/admin.rs
Lines 369 to 371 in 9564458
The text was updated successfully, but these errors were encountered: