Skip to content

Commit

Permalink
[objectstore] Fix checksums not being updated on modifying shared file
Browse files Browse the repository at this point in the history
  • Loading branch information
mrow4a committed Aug 14, 2018
1 parent 09ece7d commit f69a21a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/dav/lib/Connector/Sabre/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ public function put($data) {
}

$this->refreshInfo();
// $meta = $partStorage->getMetaData($internalPartPath);
//
// if (isset($meta['checksum'])) {
// $this->fileView->putFileInfo(
// $this->path,
// ['checksum' => $meta['checksum']]
// );
// }
//
// $this->refreshInfo();
} catch (StorageNotAvailableException $e) {
throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage());
}
Expand Down
17 changes: 17 additions & 0 deletions tests/acceptance/features/apiMain/checksums.feature
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,23 @@ Feature: checksums
And user "user0" requests the checksum of "/myChecksumFileCopy.txt" via propfind
Then the webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"

Scenario: Sharing a file with checksum should return the checksum in the propfind using new DAV path
Given using new DAV path
And user "user1" has been created
And user "user0" has uploaded file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "user0" shares file "/myChecksumFile.txt" with user "user1" using the sharing API
And user "user1" requests the checksum of "/myChecksumFile.txt" via propfind
Then the webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"

Scenario: Sharing and modifying a file should return correct checksum in the propfind using new DAV path
Given using new DAV path
And user "user1" has been created
And user "user0" has uploaded file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "user0" shares file "/myChecksumFile.txt" with user "user1" using the sharing API
And user "user1" uploads file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/myChecksumFile.txt" using the WebDAV API
And user "user0" requests the checksum of "/myChecksumFile.txt" via propfind
Then the webdav checksum should match "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399 MD5:56e57920c3c8c727bfe7a5288cdf61c4 ADLER32:1048035a"

Scenario: Copying file with checksum should return the checksum in the download header using new DAV path
Given using new DAV path
And user "user0" has uploaded file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
Expand Down

0 comments on commit f69a21a

Please sign in to comment.