Sometimes move or add operations get lost
planger opened this issue · 2 comments
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?
Synchronization on the model state object sounds reasonable to me. I don't think that a full-fledged request queue is necessary for now.