Attachments flag is dropped when applying delta to incoming rev

Description

When an incoming rev is a delta, `IncomingRev::parseAndInsert` can either decide to let the `Inserter` apply the delta later, or to apply the delta itself now. However, there is a crucial piece of code missing when the delta is applied immediately which means if; there are no blob changes in the delta, and the doc has existing blobs - the attachments flag is not applied to the new incoming rev.

The fix is pretty simple: Add a check in `IncomingRev::parseAndInsert` to see if the doc has any blobs, if it does add the `kRevHasAttachments` flag to the `IncomingRev->_rev.flags`

Activity

Show:

CB robot February 29, 2024 at 1:44 AM

Build couchbase-lite-net-3.1.6-4 contains couchbase-lite-core commit 0da8b59 with commit message:
: Attachments flag dropped when applying delta to incoming rev (#1962)

CB robot February 28, 2024 at 10:59 PM

Build couchbase-lite-c-3.1.6-6 contains couchbase-lite-core commit 0da8b59 with commit message:
: Attachments flag dropped when applying delta to incoming rev (#1962)

CB robot February 28, 2024 at 12:23 PM

Build couchbase-lite-ios-3.1.6-12 contains couchbase-lite-core commit 0da8b59 with commit message:
: Attachments flag dropped when applying delta to incoming rev (#1962)

CB robot February 28, 2024 at 2:31 AM

Build couchbase-lite-core-3.1.6-6 contains couchbase-lite-core commit 0da8b59 with commit message:
: Attachments flag dropped when applying delta to incoming rev (#1962)

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created February 27, 2024 at 5:29 PM
Updated August 31, 2024 at 10:55 AM
Resolved February 28, 2024 at 2:37 AM
Instabug