cofoundry icon indicating copy to clipboard operation
cofoundry copied to clipboard

Concurrency Question

Open ashleyNoDeal opened this issue 5 years ago • 3 comments

Hello Guys,

I was testing on editing a custom entity at a same time in different windows. So had 2 separate browser's open and pressed edit on same entity. Noticed if i edit a different field in both and save it. The last one saved will overwrite the data. Causing the initial one progress to disappear. Is their setting do i need to enable concurrency ? or like a notification to tell the user that they need to refresh.

Thank you for reading my post

ashleyNoDeal avatar Apr 18 '19 12:04 ashleyNoDeal

There's no concurrency protection built in yet unfortunately. It's a fairly big feature to add and resolving conflicts can be tricky, but as you say, it could be as simple as a notification to say that somethings changed and we need to refresh the data (losing any current changes).

HeyJoel avatar Apr 18 '19 16:04 HeyJoel

I think it is fairly standard to send something like the "last updated" timestamp with update commands and then failing the update if the stored "last update" timestamp is different. You can then ask the user "Someone else has changed the data before you - do you want to overwrite it or loose your own changes?".

The cool thing is that by adding it to custom entities, you get it implemented for all types of entities :-)

JornWildt avatar Mar 21 '21 06:03 JornWildt

A possible solution is working with websockets at this place. If there is a listener at server side it can either block the entity which should be edited or enables more functions like simultanous work on a work from different users (like Google Docs).

rwolfdev avatar Nov 02 '22 16:11 rwolfdev