-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
add command do delete orphan shares #39170
Conversation
3ac1cc7
to
4c31c31
Compare
4c31c31
to
b567ec5
Compare
b567ec5
to
baa60cd
Compare
Signed-off-by: Robin Appelman <robin@icewind.nl>
baa60cd
to
50501f8
Compare
/backport to stable27 |
/backport to stable26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does it really scale to fetch all share and then to set up the file system for each owner? Or does the
yield
statement makes it more manageable? Not familiar with it. - Do we have a logic in place to prevent those from happening?
} | ||
|
||
if ($doDelete) { | ||
$this->orphanHelper->deleteShares($orphans); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No option to delete them one by one? Maybe it is irrelevant in the use case.
It will be slow yes, but there isn't really to much that can be done for that |
If it only makes the command slow then I'd say that is fine or would it also impact "online" transactions? 👍 |
Performance impact is only for the command |
The backport to stable26 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable26
git pull origin stable26
# Create the new backport branch
git checkout -b fix/foo-stable26
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The new occ command needs admin docs |
Compared to the existing background job, this command validates that the share owner still has access to the file instead of just checking that the file still exists.
I've decided against not adding this to the background command as the "owner lost access" case is recoverable by having the owner regain access. So automatically deleting them might be undesired.
Steps to create an orphaned share:
A
,B
andC
. Create a groupfolderG
and giveA
andB
access to it.B
uploads a fileF
toG
and shares it withC
A
movesF
outsideG
C
now has an orphaned share asB
no longer has access toF