Closed michaelplutovr closed 3 years ago
After more investigation and help from @JoeLudwig the issue was that gadget stuff was getting rendered before the gadget had finished its initial handshake with the local server.
Modifying the rooms gadget to use waitForConnect from https://github.com/aardvarkxr/aardvark/pull/174 resolves the issue.
Scenario
Users A, B are in a conversation using the rooms gadget and all have gadgets out.
User C enters the room and immediately recieves room information from the network containing information about the remote universii along with their initInfo which at this point contains a gadget. Around the first frame, the rooms gadget of C instantiates and renders a remote universe with the provided init info.
In this scenario the remote gadets dies and user C is left in a broken state.
Reproduction steps
Make a rooms gadget that spawns a remote universe immediately with the init info below.
NOTE: over the wire receiver comes thorugh as null, the EndpointType.Unknown was added to make typsecript happy and should have no affect as for remote universii initInfo gadgets the receiver is ignored.
Known oddities
The child gadget does appear briefly and then segfaults or is terminated, unknown as logs are not available afaik
If extra log statements are added to the server the remote universes gadget can be seen coming online with an endpoint address of 0 but a valid nodeId, it gets roughly 3 messages attempting to be routed to this address and then is terminated and or dies.
NOTE: at the point that all of this happens, the room gadget itself is assigned an enpoint and a node id that are valid
Open questions