Description
Hi,
We using parse-server and parse android SDK for our application.
Sometimes devices with our app loses the Internet connection (poor WiFi signal, or smth else) when request to create new object is running, and usually we get connection timeout error.
But, on server site object was successfully created and stored.
Later when interned connection will restored, we send request again and get objectId
on device, AND get first object too.
It is commutation error, and now we have two same object with different objectId
on server and on local application.
As workaround, each our object has localObjectId
which generates on device, and in beforeSave
trigger we remove same objects from database.
What i propose: add support of acknowledges, smth like this:
user ---> server:
create new object instance of Foo
server ---> user:
done, objectId: 42 (server creates a timer for 'thanks' message)
user --> server:
thanks. Now server can safely save new object to database.
With this method we can safely and clearly avoid duplicates objects without overheads.
Comments are welcome.