I'm creating a simple online form where I want to send the submitted data to my Dropbox Datastore using PHP.
Now the problem is, this might cause concurrency issues which I'm not sure how to handle. Consider the following scenario where two users (A and
submit the form at the same time:
A calls get_datastore and gets rev=10
B calls get_datastore and gets rev=10
B calls put_delta with the form data and rev=10, incrementing current revision
A calls put_delta with the form data and rev=10, but this fails since current revision is now 11
I could simply make a loop and keep trying until put_delta succeeds, but this seems like bad practice since all I want is to append a record and don't really care about the revision, as far as I can see. Is there any way to make a put_delta call (or equivalent) and somehow specify rev=latest?