Couchbase Lite 2.0 deferred attachments C#

How to stop attachments from downloading in Couchbase Lite 2.o C#? Currently the attachment contents are also downloaded along with the document.

A similar functionality exists in IOS > https://github.com/couchbase/couchbase-lite-ios/wiki/Deferred-Attachment-Downloading. Not sure if we can do the same in C#.

Any code sample will be very helpful…

Thanks…

Sorry, that feature doesn’t exist in 2.0 on any platform. We do want to bring it back at some point.
(attn @priya.rajagopal)

Any update on this feature?

The original post was from few years ago. Can you please specify exactly what it is you are looking for and why in the context of your use case

I need a way to disable the attachments download without removing them server side.

Sorry but this is still unclear. Can you elaborate with an example and include details of where and how attachments are created, are these attachments expected to be synced to clients at least once , do the attachments get updated

Hi Priya,

In our case, we don’t want the attachments to sync down to Couchbase Lite as this will slow down replication and consume more bandwidth due to the huge size of the attachments (10-20 MB). The attachments are fetched/created/updated/deleted using Couchbase Sync Gateway attachment API in the cloud application and the attachment feature is disabled in the Couchbase Lite desktop client. But there is no way currently to stop the syncing down of attachments during a pull replication.

We’re looking for a feature like skipping attachments during a pull replication. Please check this feature that was available in IOS
(Deferred Attachment Downloading · couchbase/couchbase-lite-ios Wiki · GitHub)

As confirmed by Jens, unfortunately this extremely usable feature is not available in 2.0 on any platform. Are there any plans to bring this feature back?

Thanks,
Dony Thomas

The same in our case as for dony.thomas. In addition I have a question: Is there a small change that I can do in the couchbase-lite-core to disable the attachments download?

@priya.rajagopal , for example commenting out the contents of findBlobReferences(DBAccess) seems to solve the problem, but there probably is a better solution.

Hi Dony - This feature is not supported in 2.0 and there are no immediate plans for supporting this. In fact, that feature was never really supported on all platforms even in 1.0

That said, if the size of attachments is a concern and if attachments are to not be synced down to the clients (or rather they need to be done on demand by clients at a later point ), then the recommended option would be to host the attachments on an external store and only embed the URL in the documents. Then the clients can determine when to fetch the attachments from the external store.

@Ionut_Cosmin_Mihai If you make changes to the source code, that will not be officially supported and we cannot guarantee that this will work as this could have unintended side affects. I don’t suspect that this will be a “small change” - This feature cannot be handled exclusively on the client side (i.e lite core). The replication protocol would also have to be updated to avoid pulling down attachments.