Skip to content
Snippets Groups Projects
Verified Commit 28065c2e authored by Hugo Renard's avatar Hugo Renard
Browse files

fix: revert file version

parent b9f7b17e
No related branches found
No related tags found
1 merge request!19Feature s3 patch
Pipeline #1333 passed with stages
in 4 minutes and 59 seconds
...@@ -7,7 +7,8 @@ WORKDIR /apps ...@@ -7,7 +7,8 @@ WORKDIR /apps
ARG MINOR_VERSION ARG MINOR_VERSION
RUN ./install.sh RUN ./install.sh
RUN cd apps/mail && patch -p1 < ../../mail-enumeration-leak.patch RUN cd apps/mail && patch -p1 < ../../mail-enumeration-leak.patch
RUN rm ./install.sh ./install-list ./mail-enumeration-leak.patch RUN cd apps/files_versions_s3 && patch -p1 < ../../files_versions_s3.patch
RUN rm ./install.sh ./install-list ./mail-enumeration-leak.patch ./files_versions_s3.patch
FROM nextcloud:${MARKETTING_VERSION}-fpm-alpine FROM nextcloud:${MARKETTING_VERSION}-fpm-alpine
ENV VERSION $PATCH_VERSION ENV VERSION $PATCH_VERSION
......
diff --git a/lib/Versions/AbstractS3VersionBackend.php b/lib/Versions/AbstractS3VersionBackend.php
index a13e882..4b9d142 100644
--- a/lib/Versions/AbstractS3VersionBackend.php
+++ b/lib/Versions/AbstractS3VersionBackend.php
@@ -48,7 +48,7 @@ abstract class AbstractS3VersionBackend implements IVersionBackend {
abstract protected function getUrn(FileInfo $file): string;
- abstract protected function postRollback(FileInfo $file);
+ abstract protected function postRollback(FileInfo $file, IVersion $version);
public function getVersionsForFile(IUser $user, FileInfo $file): array {
$s3 = $this->getS3($file);
@@ -68,7 +68,7 @@ abstract class AbstractS3VersionBackend implements IVersionBackend {
$s3 = $this->getS3($source);
if ($s3) {
$this->versionProvider->rollback($s3, $this->getUrn($source), $version->getRevisionId());
- $this->postRollback($source);
+ $this->postRollback($source, $version);
return true;
}
diff --git a/lib/Versions/ExternalS3VersionsBackend.php b/lib/Versions/ExternalS3VersionsBackend.php
index 1d2ee00..c92e40c 100644
--- a/lib/Versions/ExternalS3VersionsBackend.php
+++ b/lib/Versions/ExternalS3VersionsBackend.php
@@ -26,6 +26,7 @@ namespace OCA\FilesVersionsS3\Versions;
use OC\Files\ObjectStore\S3ConnectionTrait;
use OC\Files\Storage\Wrapper\Jail;
use OCA\Files_External\Lib\Storage\AmazonS3;
+use OCA\Files_Versions\Versions\IVersion;
use OCP\Files\FileInfo;
use OCP\Files\Storage\IStorage;
@@ -59,7 +60,7 @@ class ExternalS3VersionsBackend extends AbstractS3VersionBackend {
return $path;
}
- protected function postRollback(FileInfo $file) {
+ protected function postRollback(FileInfo $file, IVersion $version) {
$file->getStorage()->getUpdater()->update($file->getInternalPath());
}
}
diff --git a/lib/Versions/PrimaryS3VersionsBackend.php b/lib/Versions/PrimaryS3VersionsBackend.php
index 7331676..c4eeabc 100644
--- a/lib/Versions/PrimaryS3VersionsBackend.php
+++ b/lib/Versions/PrimaryS3VersionsBackend.php
@@ -26,6 +26,7 @@ namespace OCA\FilesVersionsS3\Versions;
use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\ObjectStore\S3;
use OC\Files\ObjectStore\S3ConnectionTrait;
+use OCA\Files_Versions\Versions\IVersion;
use OCP\Files\FileInfo;
use OCP\Files\Storage\IStorage;
@@ -62,11 +63,12 @@ class PrimaryS3VersionsBackend extends AbstractS3VersionBackend {
return $storage->getURN($file->getId());
}
- protected function postRollback(FileInfo $file) {
+ protected function postRollback(FileInfo $file, IVersion $version) {
$cache = $file->getStorage()->getCache();
$cache->update($file->getId(), [
'mtime' => time(),
- 'etag' => $file->getStorage()->getETag($file->getInternalPath())
+ 'etag' => $file->getStorage()->getETag($file->getInternalPath()),
+ 'size' => $version->getSize(),
]);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment