So I’ve been trying to figure out why the onSignal
of hc-web-client stops getting called after I generate a new DNA instance. I figured out that this conductor admin call (admin/interface/add_instance
) is a bit tricky to use. I’ve encountered two problems here.
-
await
onadmin/interface/add_instance
call just loads forever and this is probably because websocket connection is being refreshed (I was able to confirm thatadmin/interface/add_instance
closes webscoket connection and opens it again) but I haven’t figured out why the refreshing of websocket connection makes this admin call load forever. - In order to bypass the first problem, I did what @guillemcordoba also did in the holochain-provider (0.0.7-alpha.32) of uprtcl here and just
setTimeout
before caling the next conductor admin call. This allows me to call the next conductor admin call ('admin/instance/start'
) and I can get a resolved value back as well. However, thews.socket.on('message', (message: any) => {}
is not executing anymore. My guess is that when theadmin/interface/add_instance
call refreshed the ws connection, either hc-web-client wasn’t able to resubscribe tomessage
OR holochain is not sending themessage
event from the hc side when a new instance is added to an existing interface already.
I’m failry sure that (admin/interface/add_instance
) is the problem here since other conductor admin doesn’t cause the onSignal
to stop executing. Right now, when I refresh my app, the onSignal
will work fine again but I would really love for it to keep listening to the signal being sent from hc side without refreshing the app even if I called the (admin/interface/add_instance
) call.
For more information, here’s the actual code and the admin/interface/add_instance
is exactly being called here.
If anyone has encountered this problem and found a workaround, it would be amazing if you could share it!
Thank you so much!