Hello!
For now the engine uses a simple rule for updates: the last command to be executed overwrites the content of the row(s) (it "wins" over previous update commands)
In the case of insertion and deletes it is the first command that "wins".
So in your example in which a node deletes a record and then the other node updates it, when these nodes are connected and synchronize, the first command will delete the row and the second will execute silently, without any error or notification about the non-existing row.
This method may not fit all the use cases, but it is very simple to implement and it may fill the majority of cases. If you have a different requirement, please inform what behavior would you need in your application.
LiteSync has now a database update notification event but I guess that the site was not updated with the last features yet. While the site is not updated, here are some code snippets:
Example in Python:
def on_db_update(arg):
print "update received"
con.create_function("update_notification", 1, on_db_update)
Example in C:
static void on_db_update(sqlite3_context *context, int argc, sqlite3_value **argv){
puts("update received");
}
sqlite3_create_function(db, "update_notification", 1, SQLITE_UTF8, NULL, &on_db_update, NULL, NULL);
Notice: The callback function is called by the worker thread. The application should not use the db connection inside the notification callback and it must return as fast as possible! The application can send the notification to the main thread before returning.