From b31794859c450c52b73fb037b0431bb71fd50e85 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 10 Aug 2021 12:44:48 +0200 Subject: [PATCH] propagate after restoring a file version (#1980) --- changelog/unreleased/propagate-restore.md | 5 +++++ pkg/storage/utils/decomposedfs/revisions.go | 7 ++++++- tests/acceptance/expected-failures-on-OCIS-storage.md | 3 --- tests/acceptance/expected-failures-on-S3NG-storage.md | 3 --- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/propagate-restore.md diff --git a/changelog/unreleased/propagate-restore.md b/changelog/unreleased/propagate-restore.md new file mode 100644 index 0000000000..f66e34af1d --- /dev/null +++ b/changelog/unreleased/propagate-restore.md @@ -0,0 +1,5 @@ +Bugfix: Propagate the etag after restoring a file version + +The decomposedfs didn't propagate after restoring a file version. + +https://github.com/cs3org/reva/pull/1980 diff --git a/pkg/storage/utils/decomposedfs/revisions.go b/pkg/storage/utils/decomposedfs/revisions.go index 729b7812cc..9c3541b440 100644 --- a/pkg/storage/utils/decomposedfs/revisions.go +++ b/pkg/storage/utils/decomposedfs/revisions.go @@ -197,7 +197,12 @@ func (fs *Decomposedfs) RestoreRevision(ctx context.Context, ref *provider.Refer return } - return fs.copyMD(revisionPath, nodePath) + err = fs.copyMD(revisionPath, nodePath) + if err != nil { + return + } + + return fs.tp.Propagate(ctx, n) } log.Error().Err(err).Interface("ref", ref).Str("originalnode", kp[0]).Str("revisionKey", revisionKey).Msg("original node does not exist") diff --git a/tests/acceptance/expected-failures-on-OCIS-storage.md b/tests/acceptance/expected-failures-on-OCIS-storage.md index 9afacd12b6..74da2f08ad 100644 --- a/tests/acceptance/expected-failures-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-on-OCIS-storage.md @@ -12,9 +12,6 @@ These tests succeed when running against ocis because there we handle the releva - [apiTrashbin/trashbinFilesFolders.feature:230](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L230) - [apiTrashbin/trashbinFilesFolders.feature:231](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L231) -#### [Implement Versions Feature for ocis storage](https://github.com/owncloud/product/issues/210) -- [apiWebdavEtagPropagation2/restoreVersion.feature:10](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation2/restoreVersion.feature#L10) - #### [Getting information about a folder overwritten by a file gives 500 error instead of 404](https://github.com/owncloud/ocis/issues/1239) These tests are about overwriting files or folders in the `Shares` folder of a user. - [apiWebdavProperties1/copyFile.feature:226](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L226) diff --git a/tests/acceptance/expected-failures-on-S3NG-storage.md b/tests/acceptance/expected-failures-on-S3NG-storage.md index f08fbd4d11..b120f7af1d 100644 --- a/tests/acceptance/expected-failures-on-S3NG-storage.md +++ b/tests/acceptance/expected-failures-on-S3NG-storage.md @@ -16,9 +16,6 @@ Basic file management like up and download, move, copy, properties, quota, trash - [apiVersions/fileVersions.feature:455](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersions.feature#L455) - [apiVersions/fileVersionsSharingToShares.feature:301](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L301) -#### [Implement Versions Feature for ocis storage](https://github.com/owncloud/product/issues/210) -- [apiWebdavEtagPropagation2/restoreVersion.feature:10](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation2/restoreVersion.feature#L10) - #### [Getting information about a folder overwritten by a file gives 500 error instead of 404](https://github.com/owncloud/ocis/issues/1239) - [apiWebdavProperties1/copyFile.feature:226](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L226) - [apiWebdavProperties1/copyFile.feature:227](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L227)