schema-collaboration icon indicating copy to clipboard operation
schema-collaboration copied to clipboard

Handle conflicts if the datapackage has been modified on the server

Open cpina opened this issue 4 years ago • 0 comments

Currently users are not warned if their changes are going to overwrite changes from another user.

Steps to reproduce:

  • Collaborator1 (or datamanager) starts editing a datapackage
  • Collaborator2 starts editing the same datapackage
  • Collaborator1 makes some changes and save
  • Collaborator2 makes some changes and save

The datapackage in the server is from Collaborator2. The changes made by Collaborator1 are lost.

Possible solutions:

  • Avoid two people editing the same datapackage at the same time. When Collaborator1 opens the datapackage on the "load" the server could track that this datapackage was opened and could avoid anyone else opening for the next X minutes. If Collaborator1 hasn't finished in X minutes: a notification in Collaborato1 datacreator would appear asking "are you still editing?" (like banking applications / Youtube / ...)
  • When the datapackage is saved: Django side could try to do a JSON merge (e.g. https://pythonhosted.org/json-merger/). If it can be merged then proceed, if not ask the user to resolve conflicts (this is still dangerous because there might not be "physical" conflicts but might be "logical" conflicts)
  • The second person to push: if the server side datapackage is different to the datapackage that was loaded: the user could get a notification and ask them to reload and edit it again

cpina avatar Oct 27 '20 11:10 cpina