You should probably use some kind of versioning so that when you receive version 123 and the version in the database is 121, you won't commit 123 until you receive #122.
If the user deletes the note and the server receives the delete request before other modification deltas, simply ignore the deltas that arrive after the delete command.
In my opinion it's a lot more simple to solve this kind of problems on the server side of a web application.
If the user deletes the note and the server receives the delete request before other modification deltas, simply ignore the deltas that arrive after the delete command.
In my opinion it's a lot more simple to solve this kind of problems on the server side of a web application.