Skip to content

fix(occ): resolve trashed/appdata files in info:file and flag trashed orphan shares - #60838

Open
juliusknorr wants to merge 4 commits into
masterfrom
fix/info-file-trashbin
Open

juliusknorr wants to merge 4 commits into
masterfrom
fix/info-file-trashbin

Conversation

@juliusknorr

@juliusknorr juliusknorr commented May 29, 2026 •

Copy link
Copy Markdown
Member

Summary

occ info:file <id> returned "file not found" for files that aren't in a user's /files folder. This fixes resolution for trashbin, versions, and appdata files, and makes sharing:delete-orphan-shares report when an orphan's file is in the trashbin.

This can be helpful when debugging inaccessible shares and makes it easier to spot for admins how to recover a share where the owner has deleted the file

@juliusknorr
juliusknorr requested a review from a team as a code owner May 29, 2026 14:05
@juliusknorr
juliusknorr requested review from CarlSchwan, artonge, icewind1991 and salmart-dev and removed request for a team May 29, 2026 14:05
@susnux susnux added this to the Nextcloud 35 milestone Jun 9, 2026
@juliusknorr
juliusknorr force-pushed the fix/info-file-trashbin branch from 23c4ab3 to 270bd6c Compare June 26, 2026 09:31
}

public function isInTrashbin(int $fileId): bool {
$query = $this->connection->getQueryBuilder();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for info, this won't work for groupfolders, but I guess this is fine

This was referenced Aug 12, 2026
@nextcloud-bot nextcloud-bot mentioned this pull request Aug 20, 2026
@skjnldsv skjnldsv mentioned this pull request Aug 25, 2026
juliusknorr and others added 4 commits September 24, 2026 15:11
The info:file command scoped the file id lookup to the user files
folder, so files in the trashbin could not be resolved. Fall back to
searching the user root which also covers files_trashbin and
files_versions.

AI-assistant: Claude Code 2.1.156 (Claude Opus 4.8)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Files that are not part of any user mount, such as appdata on the root
storage, could not be resolved by id. Fall back to looking the file up
directly on the root storage when no user mount matches.

AI-assistant: Claude Code 2.1.156 (Claude Opus 4.8)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
A shared file moved to the trashbin keeps its file id, so it is flagged
as an orphan share while still existing in the filecache. Detect this
case and tell the admin the file is in the share owner's trashbin
instead of the generic lost-access message.

AI-assistant: Claude Code 2.1.156 (Claude Opus 4.8)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
isInTrashbin() only recognizes the regular user trashbin path layout,
not the group folders trash storage. Documenting per review feedback
on #60838.

Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-sonnet-5
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@juliusknorr
juliusknorr force-pushed the fix/info-file-trashbin branch from 270bd6c to ca224da Compare September 24, 2026 14:38

This branch has not been deployed

No deployments
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