Exception in sync function

oldDoc is the body of the revision’s nearest ancestor. If Sync Gateway doesn’t have the document body for an ancestor, oldDoc will be null.

This is obviously the case for new documents, but there are other scenarios where Sync Gateway won’t have access to the ancestor body. Some of these include:

  1. The new revision is a conflicting revision, branching from an older revision that’s no longer available to Sync Gateway (Sync Gateway only retains bodies for non-tombstoned leaf revisions).
  2. This is a new document to Sync Gateway, but there have been multiple revisions made by the client that are being pushed.