Clients are expected to attach a client-ID to the messages they send to the server. However, when the server sends a message directly to a client, we also expect a clientId, to know which model/diagram is affected (See #297)
The problem is that, outside of messages sent by the client, the server doesn't really know about clientIds (It is generated on the client side when loading a new model). The clientId is also stored in the graphicalModelState (Immediately upon loading the model?).
ClientIds are also unique only per-client, so to identify one specific diagram in a multi-client scenario, we need the (GLSPClient, clientId) pair (Or (GLSPServer, clientId), since, if I'm not mistaken, there is a 1-1 mapping between GLSPServer and GLSPClient)
Currently, in #297, we work around this issue by storing the clientId - to - clientProxy mapping when receiving a message from the client (typically the LoadModelAction), but that's not ideal.
The point of this ticket is to clarify how diagrams should be uniquely identified from the server point of view, when sending a message from the server to the client, and adapt DefaultGLSPServer, GLSPClientProvider and DIActionDispatcher accordingly.
This might be part of a larger issue to scope the various providers/services: do we expect all server services to be unique and manage all diagrams and all diagrams (Using unique IDs to identify each client), or should we consider scoping the injection for each GSLPClient, or even each (GLSPClient, clientId) pair? (i.e. each loaded model)
Clients are expected to attach a client-ID to the messages they send to the server. However, when the server sends a message directly to a client, we also expect a clientId, to know which model/diagram is affected (See #297)
The problem is that, outside of messages sent by the client, the server doesn't really know about clientIds (It is generated on the client side when loading a new model). The clientId is also stored in the graphicalModelState (Immediately upon loading the model?).
ClientIds are also unique only per-client, so to identify one specific diagram in a multi-client scenario, we need the (GLSPClient, clientId) pair (Or (GLSPServer, clientId), since, if I'm not mistaken, there is a 1-1 mapping between GLSPServer and GLSPClient)
Currently, in #297, we work around this issue by storing the clientId - to - clientProxy mapping when receiving a message from the client (typically the LoadModelAction), but that's not ideal.
The point of this ticket is to clarify how diagrams should be uniquely identified from the server point of view, when sending a message from the server to the client, and adapt DefaultGLSPServer, GLSPClientProvider and DIActionDispatcher accordingly.
This might be part of a larger issue to scope the various providers/services: do we expect all server services to be unique and manage all diagrams and all diagrams (Using unique IDs to identify each client), or should we consider scoping the injection for each GSLPClient, or even each (GLSPClient, clientId) pair? (i.e. each loaded model)