revpos is missing in the changed attachment body when using delta sync

Description

This issue is found during the todo test fest between CBL iOS 3.0.1 and SG 3.0 EE with delta sync enabled (setting "delta_sync": { "enabled": true} in SG config for the database).

How to reproduce :

1. Start todo app and login with a user.
2. Create a task list.
3. Create a task.
4. Update a task twice (check and uncheck) to generate a couple of revisions.
5. Add an image to the test.
6. Update an image to the test.

In the Step 5, CBL sent the rev message as follows:

In the Step 6, CBL sent the rev message including only the attachment due to delta sync enabled.

The attachment info above doesn't include the revpos=5.

With that above, when using SG 3.0, the end result will cause the mismatch sha-1 digests stored in the SG as below:

Activity

Show:

Pasin Suriyentrakorn March 29, 2022 at 4:50 PM

This issue was fixed in https://github.com/couchbase/couchbase-lite-core/commit/44e663311d4853b8593cfb247408dd80acb75666.

Note: the ticket number in the commit's title is wrong.

Pasin Suriyentrakorn March 4, 2022 at 3:16 AM

From the code below, the ancestor's attachments' revpos are also the current revision's generation. Should it be the ancestor's revision generation instead?

https://github.com/couchbase/couchbase-lite-core/blob/master/Replicator/Pusher%2BRevs.cc#L288

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

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created March 3, 2022 at 7:41 PM
Updated August 31, 2024 at 10:55 AM
Resolved March 29, 2022 at 12:43 AM
Instabug