Deletion from Couchbase Server

Hello everyone,
I try to explain my scenario,
I have a mobile device that uses CouchBase Lite, in this device I create a document with the Java SDK with null ID. Once the document is created, it passes on the sync gateway and then ends up on couchbase server. When it arrives on couchbase server we intercept it we delete it and create a new one with the correct id (which is a progressive).
It happens that when we do the deletion and create a new one everything seems to be fine but instead after a few seconds I find the one with id null.
Why does this happen?
Should I by chance delete from the sync gateway directly ?

thank you in advance for your help.

Can you elaborate a bit more on this use-case? It’s not one I’m familiar with.

  • By null document ID, do you rely on a CBLite auto-generated UUID?
  • How do you generate the “correct” document ID on the server side?
  • How do you perform the deletion? Via Couchbase Server/SDK?
  • Does the document contents also reappear?
  • Is the new document there?