Skip to content

fix(files_trashbin): misleading trashbin:expire output when expiration is disabled - #63040

Open
joshtrichards wants to merge 1 commit into
masterfrom
jtr/fix-trashbin-occ-expire-output-when-disabled
Open

fix(files_trashbin): misleading trashbin:expire output when expiration is disabled#63040
joshtrichards wants to merge 1 commit into
masterfrom
jtr/fix-trashbin-occ-expire-output-when-disabled

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Aug 7, 2026

Copy link
Copy Markdown
Member

When trashbin_retention_obligation is set to disabled, trashbin:expire incorrectly reports the auto-expiration policy and exits with a failure status.

Report that automatic expiration is disabled and exit successfully instead.

  • Resolves: #n/a

Summary

Discovered while working on nextcloud/documentation#15421

Fixes the output and exit status of occ trashbin:expire when automatic trash-bin expiration is disabled with:

'trashbin_retention_obligation' => 'disabled',

When expiration is disabled, trashbin:expire currently prints a message describing the default auto policy:

Auto expiration is configured - keeps files and folders in the trash bin for 30 days ...

It also exits with status 1, even though the configured state is valid and no operation has failed.

This is misleading.

Changes:

  • Report that trash-bin expiration is disabled.
  • Clarify that no files or folders will be automatically expired by the command.
  • Return exit status 0 for this valid no-op condition.

Only updates occ trashbin:expire output/return value behavior for the disabled retention policy. It does not change retention-policy semantics or the behavior of trashbin:cleanup or any other aspect of the implementation.

TODO

  • n/a

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

When trashbin_retention_obligation is set to disabled, trashbin:expire incorrectly reports the auto-expiration policy and exits with a failure status.

Report that automatic expiration is disabled and exit successfully instead.

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Aug 7, 2026
@joshtrichards
joshtrichards requested a review from a team as a code owner August 7, 2026 17:30
@joshtrichards joshtrichards added bug 3. to review Waiting for reviews labels Aug 7, 2026
@joshtrichards
joshtrichards requested review from Altahrim and removed request for a team August 7, 2026 17:30
@joshtrichards joshtrichards added the ⚠️ risk: low Unlikely to cause meaningful regressions; limited runtime or compatibility impact. label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug feature: trashbin ⚠️ risk: low Unlikely to cause meaningful regressions; limited runtime or compatibility impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants