Skip to content

fix(files_trashbin): make trashbin:expire continue on errors - #65016

Merged
benjaminfrueh merged 1 commit into
masterfrom
fix/files_trashbin/expire-command
Oct 2, 2026
Merged

benjaminfrueh merged 1 commit into
masterfrom
fix/files_trashbin/expire-command

Conversation

@benjaminfrueh

@benjaminfrueh benjaminfrueh commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Since version 34 occ trashbin:expire had three potential issues introduced by the refactor in #54876

  1. False "Unknown user" + abort:
    After successfully expiring an existing user, the command outputs Unknown user <uid>, returns 1 and aborts after the first user.
    if ($user) {
    $output->writeln("Remove deleted files of <info>$userId</info>");
    $this->expireTrashForUser($user, $output);
    $output->writeln("<error>Unknown user $userId</error>");
    return 1;
    } else {
  2. Crash on users without a trash bin:
    getTrashRoot() uses ->get('files_trashbin') which throws NotFoundException if the folder doesn't exist, this should not be an error and not abort the job as the trashbin seems to be created on a users first delete.
  3. Error is rethrown and aborts job:
    Errors in expireTrashForUser() are rethrown so the loop aborts and every user after the failing one is skipped. Before refactor: Commands and background jobs for the trashbin #54876 the errors were logged and the loop continued.
    } catch (\Throwable $e) {
    $output->writeln('<error>Error while expiring trashbin for user ' . $user->getUID() . '</error>');
    throw $e;

Feedback or further suggestions welcome.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI (review and test refactor)

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
@benjaminfrueh
benjaminfrueh requested a review from a team as a code owner October 2, 2026 13:57
@benjaminfrueh benjaminfrueh added the 3. to review Waiting for reviews label Oct 2, 2026
@benjaminfrueh
benjaminfrueh requested review from CarlSchwan, come-nc, icewind1991, leftybournes and salmart-dev and removed request for a team October 2, 2026 13:57
@benjaminfrueh
benjaminfrueh requested a review from blizzz October 2, 2026 13:57
@benjaminfrueh benjaminfrueh self-assigned this Oct 2, 2026
@benjaminfrueh

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@benjaminfrueh

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@szaimen szaimen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐘

@benjaminfrueh
benjaminfrueh merged commit 471a069 into master Oct 2, 2026
255 of 264 checks passed
@benjaminfrueh
benjaminfrueh deleted the fix/files_trashbin/expire-command branch October 2, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants