Skip to content

fix(files_trashbin): create folder if missing when expiring trash#61442

Merged
susnux merged 1 commit into
nextcloud:masterfrom
invario:fix_files_trashbin_exception
Jun 22, 2026
Merged

fix(files_trashbin): create folder if missing when expiring trash#61442
susnux merged 1 commit into
nextcloud:masterfrom
invario:fix_files_trashbin_exception

Conversation

@invario

@invario invario commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

If the background job to expire trash was executed before a user had ever trashed a file, the files_trashbin folder would be missing and an exception was thrown. Change the method used from get to getOrCreateFolder instead.

Checklist

@invario invario requested a review from a team as a code owner June 19, 2026 13:03
@invario invario requested review from Altahrim, ArtificialOwl, CarlSchwan and icewind1991 and removed request for a team June 19, 2026 13:03
@invario invario changed the title fix(files_trashbin): create folder if missing when expiring fix(files_trashbin): create folder if missing when expiring trash Jun 19, 2026
@phonon112358

Copy link
Copy Markdown

The PR also solves the issue for NC 34

Comment thread apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php Outdated
@invario invario force-pushed the fix_files_trashbin_exception branch from fa93943 to 359aeda Compare June 19, 2026 17:01
@phonon112358

Copy link
Copy Markdown

can this PR also be backported to NC 34 ?

@susnux susnux added this to the Nextcloud 35 milestone Jun 22, 2026
@susnux

susnux commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

/backport to stable34

@susnux

susnux commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

/backport to stable33

Signed-off-by: invario <67800603+invario@users.noreply.github.com>
@susnux susnux force-pushed the fix_files_trashbin_exception branch from 359aeda to 34e255d Compare June 22, 2026 19:33
@susnux susnux merged commit 1f8e645 into nextcloud:master Jun 22, 2026
265 of 283 checks passed
@backportbot

backportbot Bot commented Jun 22, 2026

Copy link
Copy Markdown

The backport to stable33 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable33
git pull origin stable33

# Create the new backport branch
git checkout -b backport/61442/stable33

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 34e255d1

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/61442/stable33

Error: Failed to check for changes with origin/stable33: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@invario

invario commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Backport to 33 shouldn't be needed as the offending code isn't present yet (introduced in commit a8d69ff).

Also, thanks for the merge!

@phonon112358

Copy link
Copy Markdown

yes, in NC 33, the bug didn't occur. So, no backport needed.

@invario invario deleted the fix_files_trashbin_exception branch June 22, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: files_trashbin logged NotFoundException /USERNAME/files_trashbin Error while expiring trashbin for user USERNAME

5 participants