We made a change in couchbase lite that fixed issues with deferred download of attachments. This is mostly working in production, except for one issue we have come across. Here are the steps…
- Pull from server, but don’t download attachments
- Change a document locally (but do not push changes)
- Attempt to download attachment on changed document
Step 3 fails with 404 missing as the revision id is unknown to sync gateway. It seems that in this circumstance that sync gateway should return the attachment for the last known revision. We made a quick change to validate this works. Any thoughts on whether this is the right approach?
It seems reasonable to me that in the case that the client does not have an attachment and asks the server then the best the server can do is return the attachment for the latest revision.