Skip to content

Commit 673c512

Browse files
committed
ING-1104: Add support for mutation tokens with MutateIn.
1 parent cc57023 commit 673c512

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

dataapiv1/spec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,8 @@ paths:
858858
headers:
859859
ETag:
860860
$ref: '#/components/headers/ETag'
861+
X-CB-MutationToken:
862+
$ref: '#/components/headers/MutationToken'
861863
content:
862864
application/json:
863865
schema:

gateway/dapiimpl/server_v1/dataapi_subdoc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ func (s *DataApiServer) MutateInDocument(
306306

307307
resp := dataapiv1.MutateInDocument200JSONResponse{
308308
Headers: dataapiv1.MutateInDocument200ResponseHeaders{
309-
ETag: casToHttpEtag(result.Cas),
309+
ETag: casToHttpEtag(result.Cas),
310+
XCBMutationToken: tokenFromGocbcorex(in.BucketName, result.MutationToken),
310311
},
311312
}
312313

gateway/test/dapi_crud_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3771,8 +3771,7 @@ func (s *GatewayOpsTestSuite) TestDapiMutateIn() {
37713771

37723772
requireRestSuccess(s.T(), resp)
37733773
assertRestValidEtag(s.T(), resp)
3774-
// ING-1104
3775-
// assertRestValidMutationToken(s.T(), resp, s.bucketName)
3774+
assertRestValidMutationToken(s.T(), resp, s.bucketName)
37763775

37773776
checkDocument(docId, []byte(`{
37783777
"num":42,

0 commit comments

Comments
 (0)