Skip to content

Handling conflicts

When a file is edited, the change is detected and uploaded. Each upload means a new dataUrl is generated which uniquely identifies the binary content on the server.

See Files Architecture for sequence diagrams.

After that is completed an event is raised to the hosted aeppic application which usually would edit the instance of the aeppic document in the correct file field and save it.

But it is possible, that the another person was also editing the same file on another machine/client and this would cause a loss of data when calling editFile again.

editFile will raise an exception when this is detected and the error will include the expected dataUrl.

{
  DataUrlOutOfSync: {
    data_url_specified: "aeppic-local://client/98b70521-8617-4fcf-ab4b-97509f579013",
    last_known_data_url: "aeppic-local://client/98b70521-8617-4fcf-ab4b-97509f579013dasdasd"
  }
}

In this case either:

  1. delete the local file (deleteFile) and call it again.
  2. call openFile / editFile without a dataUrl or with the correct last_known_data_url) to allow the user to look at the local file first.