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:
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?
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: