nodos-dev / nodos

0 stars 0 forks source link

BeginRequest & EndRequest don't work well with multiple clients over single API connection #6

Open bulentv opened 4 days ago

bulentv commented 4 days ago

These two events appear to be deduplicating entries in the undo/redo stack, which could be problematic in scenarios where a system uses a single API connection to the Nodos launcher while serving multiple users or frontends. Since Nodos receives all messages over the same socket, it cannot accurately group or de-duplicate events for individual users.

Tag: RHUB-1470

candhyan commented 3 days ago

Thanks @bulentv can we have the steps to reproduce, expected behaviour and observed behaviour?

bulentv commented 3 days ago

Hi @candhyan,

It is not possible to reproduce this issue using the Nodos Editor because it utilizes a connection per client to the Launcher.

Consider a scenario where two Reality Hub users are working in their browsers, both connected to the Nodos Launcher through a single RH backend, which itself is connected to the Nodos Launcher via a single TCP connection on port 50052. Both users attempt to modify the value of a property on two different nodes simultaneously. As a result, two BeginRequests, two EndRequests, and multiple value change events are sent to the Nodos Launcher over the same connection in an interleaved manner, depending on when each user presses and releases their mouse buttons, leading to a sequence like the following:

BeginRequest (User A) ValueChange 1 (User A) BeginRequest (User B) ValueChange 1 (User B) ValueChange 2 (User A) ValueChange 3 (User A) EndRequest (User A) EndRequest (User B)

This results in a chaotic order, as there is no mechanism in the protocol to identify which action originated from which frontend user. Consequently, the Nodos Launcher is unable to perform grouping or deduplication effectively. I hope this helps to clarify the issue.