gentics / mesh-ui

Gentics Mesh UI
https://getmesh.io
Apache License 2.0
23 stars 27 forks source link

Not refreshing node fields when concurrently editing node #335

Open zmeireles opened 3 years ago

zmeireles commented 3 years ago

Mesh version

The version of https://demo.getmesh.io/mesh-ui/ available at this issue creation time

Steps to reproduce

Open 2 Chrome browser windows on https://demo.getmesh.io/mesh-ui/

Window 1: Log in

Window 2: Log in

Window 1: Create a node of type Content and fill fields Slug, Title, Teaser with the string "1". Save (v0.1 is created)

Window 2: Refresh the browser window. Verify that Content Node "1" appears in the left pane

Window 1: Edit the node "1" and change the Title field to string "2". Save (v0.2 is created)

Window 2: Verify that Content Node "1" remains on the left pane. Edit this node. Verify that the Title on the right pane still has the incorrect value "1". The values on the left pane and top pane are correct, including the version (v0.2)

Expected results In Window 2 the field Title in the right pane should display the value "2"

This bug is having a serious impact in our multi-user environment, causing loss of data

Jotschi commented 3 years ago

Hello,

I ran the following steps:

Window 1: Log in Window 2: Log in

Window 1: Create a node of type Content and fill fields Slug, Title, Teaser with the string "abc". Save (v0.1 is created) Window 2: Refresh the browser window. Open node and verify that Content Node "abc" appears in the left pane

Window 1: Edit the node and change the Title field to string "abc2". Save (v0.2 is created) Window 2: Verify that Node remains on the left pane. Edit this node. Change string to "abc3". Save

The last save in window 2 will result in an error since a 409 conflict error is returned by Mesh. The UI should react and display a conflict resolution view. This seems to be broken but the node was not saved and no data was overwritten.

With your steps I was not able to reproduce the "data loss". Mesh will always compare version numbers and detect changes which other users have entered in order to prevent such cases. Only a reload of the node edit window would cause the ui to load the new version and content. A save operation will still succeed when user 2 applied the same changes as user 1 did. In those cases no conflict will ocurre.