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

[Bug]: Sharing records are not deleted after a file/folder has been permanently deleted #49932

Open
4 of 8 tasks
luka-nextcloud opened this issue Dec 20, 2024 · 4 comments
Open
4 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug

Comments

@luka-nextcloud
Copy link
Contributor

luka-nextcloud commented Dec 20, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

Right now, deleting a file/folder does not delete its corresponding sharing records. After a file/folder has been deleted, sharing records should also be deleted.

Steps to reproduce

  1. Create a file/folder
  2. Share the created file/folder
  3. Permanently delete that file/folder
  4. Check table oc_share
    Expect: It's sharing records deleted
    Actual: It's sharing records still exist

Expected behavior

Sharing records should also be removed from the oc_share table.

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

Reproducible on 28, 29, 30, master

@luka-nextcloud luka-nextcloud added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 20, 2024
@nickvergessen
Copy link
Member

This would mean if you accidentally delete a file and restore it from the trashbin, all shares are still destructed.

If we rephrase

After a file/folder has been deleted, sharing records should also be deleted.

to

After a file/folder has been deleted and removed from the trashbin, sharing records should also be deleted.

it would work. But I somewhat expect that this is already the case.

@luka-nextcloud
Copy link
Contributor Author

I agree that we should only remove sharing records after a file/folder has been permanently deleted. Now the sharing records still exist even after the permanent delete.

@luka-nextcloud luka-nextcloud changed the title [Bug]: Sharing records are not deleted after a file/folder has been deleted [Bug]: Sharing records are not deleted after a file/folder has been permanently deleted Dec 20, 2024
@nickvergessen
Copy link
Member

This daily running job should clear them:

class DeleteOrphanedSharesJob extends TimedJob {

@XueSheng-GIT
Copy link

Does this daily job work as expected? Two weeks ago I had an issue with moving a share and finally found out that it was becaus of an orphaned share. After running occ sharing:delete-orphan-shares the issue was resolved.
Because this was an old share, I question whether this daily job is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug
Projects
None yet
Development

No branches or pull requests

4 participants