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

[stable26] handle storage not available when expiring versions #43124

Merged
merged 1 commit into from Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/files_versions/lib/Storage.php
Expand Up @@ -63,6 +63,7 @@
use OCP\Files\NotFoundException;
use OCP\Files\Search\ISearchBinaryOperator;
use OCP\Files\Search\ISearchComparison;
use OCP\Files\StorageInvalidException;
use OCP\Files\StorageNotAvailableException;
use OCP\IURLGenerator;
use OCP\IUser;
Expand Down Expand Up @@ -603,6 +604,10 @@ public static function expireOlderThanMaxForUser($uid) {
} catch (NotFoundException $e) {
// Original node not found, delete the version
return true;
} catch (StorageNotAvailableException | StorageInvalidException $e) {
// Storage can't be used, but it might only be temporary so we can't always delete the version
// since we can't determine if the version is named we take the safe route and don't expire
return false;
} catch (DoesNotExistException $ex) {
// Version on FS can have no equivalent in the DB if they were created before the version naming feature.
// So we ignore DoesNotExistException.
Expand Down