We store one or more photo image blobs with our Documents in Couchbase Lite .NET with Xamarin Forms on iOS and Android. The blob contains the binary data of the (usually) JPEG. Our users have reported that some of the photos became corrupted, part of the photo data is lost. Unsure exactly what our users did to cause this I tried various things to reproduce the issue. I created 10 Documents with 3 photos each taken with the mobile camera. I started a one-time replication to push these blobs to the server – we do not currently use continuous replication. During the replication I went into the app switcher and swiped to close the mobile app. One of the photos on the server ended up corrupted, just like our users reported.
Obviously the app shouldn’t be closed like this during a replication, or maybe the app crashed during replication for whatever reason, but nonetheless, the blob should not be stored in a corrupted state on the server. It should either be saved completely, or not at all.
Couchbase Server Community Edition 6.0.0 build 1693
Sync Gateway 2.1.2 (2;35fe28e)
Couchbase Lite 2.1.2 and 2.5.
Xamarin Forms 3.x and 4.0.
Problem reproduced on iOS, not tried on Android.
Attached is the logfile from the Gateway when the sudden disconnect happened.
corrupted_blobs_log.txt.zip (2.3 KB)