Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decomposedfs: set mtime during upload #1874

Merged
merged 2 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-mtime-during-upload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Use the original file mtime during upload

The decomposedfs was not using the original file mtime during uploads.

https://github.com/cs3org/reva/pull/1874
8 changes: 4 additions & 4 deletions pkg/storage/utils/decomposedfs/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,13 +587,13 @@ func (upload *fileUpload) FinishUpload(ctx context.Context) (err error) {
}
}
// use set arbitrary metadata?
/*if upload.info.MetaData["mtime"] != "" {
err := upload.fs.SetMtime(ctx, np, upload.info.MetaData["mtime"])
if upload.info.MetaData["mtime"] != "" {
err := n.SetMtime(ctx, upload.info.MetaData["mtime"])
if err != nil {
log.Err(err).Interface("info", upload.info).Msg("Decomposedfs: could not set mtime metadata")
sublog.Err(err).Interface("info", upload.info).Msg("Decomposedfs: could not set mtime metadata")
return err
}
}*/
}

n.Exists = true

Expand Down
45 changes: 0 additions & 45 deletions tests/acceptance/expected-failures-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,33 +165,6 @@ _ocdav: return checksum in upload response for chunked upload_
- [apiMain/checksums.feature:319](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L319) Scenario: Upload overwriting a file with new chunking and correct checksum
- [apiMain/checksums.feature:331](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L331) Scenario: Upload overwriting a file with new chunking and invalid checksum

#### [Preserve mtime after TUS upload](https://github.com/owncloud/ocis-reva/issues/174)
Scenario Outline: upload file with mtime `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:160](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L160)
- [apiWebdavUpload1/uploadFile.feature:161](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L161)
Scenario Outline: upload a file with mtime in a folder `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:173](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L173)
- [apiWebdavUpload1/uploadFile.feature:174](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L174)
Scenario Outline: moving a file does not change its mtime `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:187](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L187)
- [apiWebdavUpload1/uploadFile.feature:188](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L188)
Scenario Outline: overwriting a file changes its mtime `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:200](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L200)
- [apiWebdavUpload1/uploadFile.feature:201](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L201)

#### [ocis-storage does not use the mtime send in the `Upload-Metadata` header when uploading via TUS](https://github.com/owncloud/ocis/issues/965)
- [apiWebdavUploadTUS/uploadFileMtime.feature:17](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L17)
- [apiWebdavUploadTUS/uploadFileMtime.feature:18](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L18)
- [apiWebdavUploadTUS/uploadFileMtime.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L27)
- [apiWebdavUploadTUS/uploadFileMtime.feature:28](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L28)
- [apiWebdavUploadTUS/uploadFileMtime.feature:38](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L38)
- [apiWebdavUploadTUS/uploadFileMtime.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L39)
- [apiWebdavUploadTUS/uploadFileMtime.feature:49](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L49)
- [apiWebdavUploadTUS/uploadFileMtime.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L50)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:40](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L40)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:41](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L41)


#### [Webdav LOCK operations](https://github.com/owncloud/ocis/issues/1284)
- [apiWebdavLocks/exclusiveLocks.feature:18](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks/exclusiveLocks.feature#L18)
- [apiWebdavLocks/exclusiveLocks.feature:19](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks/exclusiveLocks.feature#L19)
Expand Down Expand Up @@ -648,8 +621,6 @@ File and sync features in a shared scenario
- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:157](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L157)
- [apiShareOperationsToShares1/gettingShares.feature:170](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/gettingShares.feature#L170)
- [apiShareOperationsToShares1/gettingShares.feature:171](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/gettingShares.feature#L171)
- [apiSharePublicLink1/createPublicLinkShare.feature:736](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L736)
- [apiSharePublicLink1/createPublicLinkShare.feature:747](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L747)

#### [Shares are not deleted when user is deleted](https://github.com/owncloud/ocis/issues/1258)
- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:101](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L101)
Expand Down Expand Up @@ -756,14 +727,6 @@ File and sync features in a shared scenario
- [apiShareOperationsToShares1/gettingSharesSharedFilteredEmpty.feature:79](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/gettingSharesSharedFilteredEmpty.feature#L79)
- [apiShareOperationsToShares1/gettingSharesSharedFilteredEmpty.feature:80](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/gettingSharesSharedFilteredEmpty.feature#L80)


#### [Cannot set mtime on upload](https://github.com/owncloud/product/issues/271)

- [apiSharePublicLink1/createPublicLinkShare.feature:717](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L717)
- [apiSharePublicLink1/createPublicLinkShare.feature:718](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L718)
- [apiSharePublicLink1/createPublicLinkShare.feature:732](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L732)
- [apiSharePublicLink1/createPublicLinkShare.feature:733](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L733)

#### [Public link enforce permissions](https://github.com/owncloud/ocis/issues/1269)

- [apiSharePublicLink1/accessToPublicLinkShare.feature:10](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/accessToPublicLinkShare.feature#L10)
Expand Down Expand Up @@ -1384,14 +1347,6 @@ _ocs: api compatibility, return correct status code_
#### [user can access version metadata of a received share before accepting it](https://github.com/owncloud/ocis/issues/760)
- [apiVersions/fileVersionsSharingToShares.feature:278](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L278)

#### [ocis-storage PROPFIND on a file uploaded by share receiver is not possible](https://github.com/owncloud/ocis/issues/968)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L26)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L27)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:55](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L55)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:56](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L56)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:70](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L70)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:71](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L71)

#### [Share lists deleted user as 'user'](https://github.com/owncloud/ocis/issues/903)
- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:641](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L641)
- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:642](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L642)
Expand Down
44 changes: 0 additions & 44 deletions tests/acceptance/expected-failures-on-S3NG-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,33 +164,6 @@ _ocdav: return checksum in upload response for chunked upload_
- [apiMain/checksums.feature:319](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L319) Scenario: Upload overwriting a file with new chunking and correct checksum
- [apiMain/checksums.feature:331](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L331) Scenario: Upload overwriting a file with new chunking and invalid checksum

#### [Preserve mtime after TUS upload](https://github.com/owncloud/ocis-reva/issues/174)
Scenario Outline: upload file with mtime `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:160](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L160)
- [apiWebdavUpload1/uploadFile.feature:161](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L161)
Scenario Outline: upload a file with mtime in a folder `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:173](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L173)
- [apiWebdavUpload1/uploadFile.feature:174](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L174)
Scenario Outline: moving a file does not change its mtime `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:187](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L187)
- [apiWebdavUpload1/uploadFile.feature:188](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L188)
Scenario Outline: overwriting a file changes its mtime `expected -'1565237893', actual +'1611153591'`
- [apiWebdavUpload1/uploadFile.feature:200](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L200)
- [apiWebdavUpload1/uploadFile.feature:201](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L201)

#### [ocis-storage does not use the mtime send in the `Upload-Metadata` header when uploading via TUS](https://github.com/owncloud/ocis/issues/965)
- [apiWebdavUploadTUS/uploadFileMtime.feature:17](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L17)
- [apiWebdavUploadTUS/uploadFileMtime.feature:18](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L18)
- [apiWebdavUploadTUS/uploadFileMtime.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L27)
- [apiWebdavUploadTUS/uploadFileMtime.feature:28](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L28)
- [apiWebdavUploadTUS/uploadFileMtime.feature:38](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L38)
- [apiWebdavUploadTUS/uploadFileMtime.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L39)
- [apiWebdavUploadTUS/uploadFileMtime.feature:49](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L49)
- [apiWebdavUploadTUS/uploadFileMtime.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtime.feature#L50)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:40](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L40)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:41](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L41)


#### [Webdav LOCK operations](https://github.com/owncloud/ocis/issues/1284)
- [apiWebdavLocks/exclusiveLocks.feature:18](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks/exclusiveLocks.feature#L18)
- [apiWebdavLocks/exclusiveLocks.feature:19](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks/exclusiveLocks.feature#L19)
Expand Down Expand Up @@ -767,15 +740,6 @@ File and sync features in a shared scenario

- [apiShareOperationsToShares1/gettingShares.feature:170](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/gettingShares.feature#L170)
- [apiShareOperationsToShares1/gettingShares.feature:171](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/gettingShares.feature#L171)
- [apiSharePublicLink1/createPublicLinkShare.feature:736](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L736)
- [apiSharePublicLink1/createPublicLinkShare.feature:747](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L747)

#### [Cannot set mtime on upload](https://github.com/owncloud/product/issues/271)

- [apiSharePublicLink1/createPublicLinkShare.feature:717](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L717)
- [apiSharePublicLink1/createPublicLinkShare.feature:718](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L718)
- [apiSharePublicLink1/createPublicLinkShare.feature:732](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L732)
- [apiSharePublicLink1/createPublicLinkShare.feature:733](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature#L733)

#### [Public link enforce permissions](https://github.com/owncloud/ocis/issues/1269)

Expand Down Expand Up @@ -1385,14 +1349,6 @@ _ocs: api compatibility, return correct status code_
#### [user can access version metadata of a received share before accepting it](https://github.com/owncloud/ocis/issues/760)
- [apiVersions/fileVersionsSharingToShares.feature:278](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L278)

#### [ocis-storage PROPFIND on a file uploaded by share receiver is not possible](https://github.com/owncloud/ocis/issues/968)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L26)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L27)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:55](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L55)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:56](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L56)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:70](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L70)
- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:71](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L71)

#### [Share lists deleted user as 'user'](https://github.com/owncloud/ocis/issues/903)
- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:641](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L641)
- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:642](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L642)
Expand Down