Since 2.7.6, combining a Counter sub-doc operation combined with an Upsert is failing by not completing at all. Only affects connections with Enhanced Durability enabled. Reproducible by adding the following tests to CouchbaseBucket_SubDocument_Tests:
[Test]
|
[TestCase(true)]
|
[TestCase(false)]
|
public void MutateIn_Counter_WithUpsert_ReturnsSuccess(bool useMutation)
|
{
|
var bucket = GetBucket(useMutation);
|
var key = "MutateInAsync_Counter_WithValidPathAndCreateParentsFalse_ReturnsSuccess";
|
bucket.Upsert(key, new { foo = "bar", bar = "foo", count=0 });
|
|
var builder = bucket.MutateIn<dynamic>(key)
|
.Counter("baz", 1, false)
|
.Upsert("foo", "bar2", false);
|
|
var result = builder.Execute();
|
|
Assert.AreEqual(ResponseStatus.Success, result.Status);
|
}
|
|
[Test]
|
[TestCase(true)]
|
[TestCase(false)]
|
public async Task MutateInAsync_Counter_WithUpsert_ReturnsSuccess(bool useMutation)
|
{
|
var bucket = GetBucket(useMutation);
|
var key = "MutateInAsync_Counter_WithValidPathAndCreateParentsFalse_ReturnsSuccess";
|
bucket.Upsert(key, new { foo = "bar", bar = "foo", count=0 });
|
|
var builder = bucket.MutateIn<dynamic>(key)
|
.Counter("baz", 1, false)
|
.Upsert("foo", "bar2", false);
|
|
var result = await builder.ExecuteAsync();
|
|
Assert.AreEqual(ResponseStatus.Success, result.Status);
|
}
|