Couchbase Server 6.5
Couchbase Lite Android 2.7.0
Sync Gateway 2.7.2
Good morning all,
I use Couchbase mobile with sync gateway and I notice something strange …
If I add / update a blob attachment everything is fine but if I update this attachment with a file that has already been added previously the metadata are not updated !
Do you have any info on this bug?
If the problem comes from revisions, I just need the last synchronized change to be used. Do you think that disabling confli resolution and going to 1 revision can help me?
“allow_conflicts”: false,
“revs_limit”: 1
I have a little more info :
I think it is the limit of 20Mb per document because I can put images and at a moment only the small images synchronize more nothing. It would seem that the weight of the previous image remains on the document while it has been changed
To answer your question, here is my code (I don’t think it will help you because it is sync side that it messes up):
Set
this.android = new com.couchbase.lite.Database(name, this.config);
const document = this.android.getDocument(id).toMutable();
const nativeBlob = new com.couchbase.lite.Blob(mimeType, new java.net.URL(blob));
document.setBlob(name, nativeBlob);
Get
let document = this.android.getDocument(id) as com.couchbase.lite.Document;
if (!document) return null;
const blob = document.getBlob(name);
if (!blob) return null;
new Blob(blob);
On the client side there is no problem, I update the blobs to infinity without problem, during the sync with the server the pull goes well and the good blob data is sent
It is on the server where after many update the metadata no longer updated for the blob (attachment) and therefore the push to the clients have the old blob…