RBVI / LookSee

LookSee molecular viewer for Quest VR headsets
2 stars 0 forks source link

Meeting somehow gets two models with same id that move together #3

Closed tomgoddard closed 11 months ago

tomgoddard commented 11 months ago

I ran into a two-person meeting case where the host had 3 copies of a small molecule open and the participant had only two copies. Two of the 3 host copies moved together when dragged by the host with some lag between the two copies. It appears that those two host copies had the same meeting model id, so moving one updated its position for the participant and maybe that went back to the host (that also should not happen) updating the other clone's position. Hiding one clone from the host Models pane immediately hid the other too. And hiding the participants one copy of that clone, caused both to hide for the host.

I must not understand this completely. I had the non-host leave the meeting and close their two copies, then rejoin. To my surprise the hosts 3 copies then moved independently, and the non-hosts 3 copies moved independently and everything seemed to work correctly. I then closed one model in the host, and it closed for the non-host, then closed one model on the non-host and it closed for the host, then closed the final model on the host and it did not close on the non-host and the non-host got disconnected from the meeting I guess due to an error on the non-host.

The meeting_models dictionary maps model_id to model, so a model_id can only map to one model when interpreting messages. This also makes the observed behavior perplexing.

tomgoddard commented 11 months ago

This bug is easy to reproduce with a 2-person meeting. Open model and start meeting on first headset, then open the same model on second headset and join meeting. The joiner correctly gets two copies of the same model that move independently, while the host gets 3 copies with two of them moving together.

This may be a bug introduced in yesterday's code changes.

tomgoddard commented 11 months ago

The problem is that the host sent its model to the new participant, and then the new participant sent the two models including the one the host sent back to the host. The participant should not send the model from the host back to the host.

tomgoddard commented 11 months ago

Fixed.

Made sure the participant only sends models that have not come from the host.