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 1 month ago

bulentv commented 1 month 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 1 month ago

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

bulentv commented 1 month 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.

mswf commented 1 month ago

Could we also fix this issue better if the RH backend over that single connection to Nodos gains the ability to send commands as if they are different "user agents", per Reality Hub user? Not only could the Start/End transaction be connection to different user Ids, general logging in Nodos can also become much more useful as instead of actions coming from the generic "RealityHub", you can actually log and trace them as coming from "RH:UserA" and "RH:UserB"?