eclipsesource / graphical-lsp

Graphical language server platform for building web-based diagram editors
https://www.eclipse.org/glsp
Eclipse Public License 2.0
36 stars 8 forks source link

Sometimes move or add operations get lost #342

Open planger opened 4 years ago

planger commented 4 years ago

I suspect that this is a concurrency issue. If multiple operation requests are sent from the client to the server within a short period of time, the second one might be started before the first one finished, so that the update that is sent back to the client after the second operation doesn't contain the side-effects of the first operation. But this is just a guess, I haven't analyzed it.

In any case, I think it makes sense to have a queue on the server so that we process incoming requests in fifo style making sure that we don't run an operation before the previous operation has been finished. I think the simplest fix would be to synchronize the operation handlers on the model state object. The more thorough change would be introducing a request queue, but I guess this is not necessary for now, since synchronization on the model state object would suffice. What do you think?

planger commented 4 years ago

Might be related to #327

tortmayr commented 4 years ago

Synchronization on the model state object sounds reasonable to me. I don't think that a full-fledged request queue is necessary for now.