MutateIn throws CAS error instead of KeyExists when doc exists and StoreSemantics.Insert

Description

I am not 100% sure of of the expected behavior, but MutateInAsync throws a CasMismatchException if a document exists and StoreSementics.Insert is provided:

var insert = await collection.MutateInAsync(key, specs => specs.Upsert("foo", i1, createPath: true), options=>options.StoreSemantics(StoreSemantics.Insert))                         .ConfigureAwait(false);

I believe this should be a DocumentExistsException as the server returns KeyExists.

https://github.com/couchbase/couchbase-net-client/blob/master/src/Couchbase/Core/IO/ResponseStatusExtensions.cs#L22-L26

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:
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 June 8, 2022 at 8:10 PM
Updated June 23, 2022 at 10:29 PM
Resolved June 23, 2022 at 10:29 PM
Instabug