Description
We want to add tests to verify the behaviour of Couchbase Lite when documents are resurrected via the SDK with shared_bucket_access enabled. The top priority is CBL 2.0, but validating against 1.x is also desirable.
Here are the cases we want to cover. All of these assume:
- Sync Gateway is running with shared_bucket_access enabled, import_docs:continuous
- All steps that update via the SDK also imply 'wait for document to be imported by SG'
Case 1. Document recreated with new body, CBL had tombstone
1. Create, update, then delete a document via SDK.
2. Replicate the document to CBL
3. Recreate the document via SDK, with a different body
4. Run a pull replication on CBL to retrieve the updated document
Expected result: Active revision on CBL is the one created in step 3
Case 2. Document recreated with new body, CBL had non-tombstone
1. Create and update a document via SDK
2. Replicate the document to CBL (one-shot pull replication)
3. Delete and then recreate the document via SDK with a new body
4. Replicate the document to CBL (one-shot pull)
Expected result: Active revision on CBL is the one created in step 3
Case 3. Document recreated with identical body, CBL had tombstone
1. Create, update, then delete a document via SDK.
2. Replicate the document to CBL
3. Recreate the document via SDK, with the same body as the original create
4. Run a pull replication on CBL to retrieve the updated document
Expected result: Active revision on CBL is the one created in step 3
Case 4. Document recreated with identical body, CBL had non-tombstone
1. Create and update a document via SDK
2. Replicate the document to CBL (one-shot pull replication)
3. Delete and then recreate the document via SDK with the same body as the original create
4. Replicate the document to CBL (one-shot pull)
Expected result: Active revision on CBL is the one created in step 3
Case 5. Document recreated with new body, CBL had tombstone, CBL updates
1. Create, update, then delete a document via SDK.
2. Replicate the document to CBL
3. Recreate the document via SDK, with a different body
4. Run a pull replication on CBL to retrieve the updated document
5. Delete the document on CBL, recreate the document on CBL
6. Push document to SG
Expected result: Push succeeds, active revision on SG is version created in step 5