Issue API: how do you handle an update conflict?

Added by Khalid Dermoumi over 2 years ago

Hi redmine community!

I was just looking at the API documentation and I am wondering: how do you treat an update conflict of issues?

Consider this scenario:
1. client "a" GETs an issue "i" via the API
2. "i" gets modified by someone who is not using "a"
3. the user using "a" modifies "i"
4. "a" now PUTs the modified "i" back to the API.

Of course there is an update conflict now.
But how is it handled?
From the documentation, it looks like redmine API can not see that there is an update conflict (because there is nothing that indicates this in the example). If that is the case, then the update in 4. will simply overwrite the changes made in 2.
Is this really how the redmine API works??
I've seen there is an "updated" timestamp in the issue. But:
a) it only has a resolution of a second
b) there is nothing that says this timestamp is required in the update (PUT) operation. In the PUT example, it isn't passed too.

So if the documentation is correct, data can get lost silently by using the API ...