> On Jul 16, 2015, at 2:19 AM, Jonas Schmid <[email protected]> wrote:
> 
> I have problems with the sync function with deleted documents. When I delete 
> a document, the other users do not see it as deleted. They do not receive the 
> update.

Usually when this happens it means that your sync function is rejecting 
deletion (‘tombstone’) revisions.

Deletions are sort of a special case, because a typical deletion revision just 
looks like {“id”:”xxx”, “_deleted”:true}, with no other properties. A common 
mistake is to have your sync function require other properties — like “type” or 
“owner” or whatever — and throw an exception if they’re not present. This will 
unintentionally reject deletions.

In general the sync function will need to check for (doc._deleted === true) and 
if so skip any checks for required properties. You do also probably want to 
look at the oldDoc to validate that it’s legal for the user to delete this 
document.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/6122CFAC-A743-4539-9B16-5A0545027629%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to