Skip to content

Commit 5520d96

Browse files
committed
✨ add nullVersionId to master and current version object
1 parent 044d71f commit 5520d96

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/api/apiUtils/object/versioning.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ function processVersioningState(mst, vstat, nullVersionCompatMode) {
253253
}
254254
return { options, nullVersionId };
255255
}
256+
256257
if (mst.isNull && !mst.isNull2) {
257258
// if master null version was put with an older
258259
// Cloudserver (or in compat mode), there is a
@@ -348,6 +349,8 @@ function versioningPreprocessing(bucketName, bucketMD, objectKey, objMD,
348349
if (!nullVersionId) {
349350
return process.nextTick(next);
350351
}
352+
353+
options.nullVersionId = nullVersionId;
351354
return _storeNullVersionMD(bucketName, objectKey, nullVersionId, objMD, log, next);
352355
},
353356
function prepareNullVersionDeletion(next) {

lib/routes/routeBackbeat.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,12 @@ function putMetadata(request, response, bucketInfo, objMd, log, callback) {
667667
}
668668

669669
const masterObject = JSON.parse(masterObjectAndBucket.obj);
670-
await versioningPreprocessingPromised(bucketName, bucketInfo, objectKey, masterObject, log);
670+
const versioningPreprocessingResult =
671+
await versioningPreprocessingPromised(bucketName, bucketInfo, objectKey, masterObject, log);
672+
673+
if (versioningPreprocessingResult?.nullVersionId) {
674+
omVal.nullVersionId = versioningPreprocessingResult.nullVersionId;
675+
}
671676
}
672677
},
673678
next => {

0 commit comments

Comments
 (0)