-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Delete orphaned shares in a background job #14676
Conversation
$foldersShared = \OCP\Share::getItemsShared('file'); | ||
$this->assertCount(1, $foldersShared); | ||
|
||
// TODO: run commands |
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.
#14644 provides $this->runCommands()
for that
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.
#14644 is now merged
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.
I know, I need to get my hands dirty again here 😄
Fixes #6985 |
ab5e634
to
7d9b937
Compare
@MorrisJobke check this out, you asked about the SQL query to delete orphaned shares |
|
7d9b937
to
f1074fe
Compare
f1074fe
to
8e25d90
Compare
Added unit test and special case for SQLite. |
|
After discussing with @MorrisJobke we decided to go the sub-query approach which works for all DBs (note that the current approach also fails on PostgreSQL). I'll make the change. |
|
Retested with a shared address book. I can confirm that only the orphaned folder share was deleted. |
8b02313
to
7fb7774
Compare
Squashed and jenkins PR update pushed :) |
Individual test pass locally but not on Jenkins, possibly a side-effect of other tests:
I'll see what I can do. |
7fb7774
to
17b1413
Compare
Rebased onto master |
Jenkins PR: #15457 |
Still the same:
|
The test doesn't work any more because somehow the trashbin appears and moves the files to trash instead of a full deletion. For some reason it didn't many commits ago. I'll try and find a solution. |
@PVince81 related to storage wrapping? |
A new inspection was created. |
Jenkins PR: #15466 |
@nickvergessen yes, but the wrapping is normal here (not a bug). |
Refer to this link for build results (access rights to CI server needed): |
Tests passed, please review @MorrisJobke @DeepDiver1975 @LukasReschke @nickvergessen |
Tested and works 👍 |
maybe @rullzer or @Xenopathic want to review this? ;) |
@LukasReschke @nickvergessen @DeepDiver1975 Reviewers needed :) |
👍 |
Delete orphaned shares in a background job
Partial fix for #12323
Fixes #14664
integrate with CleanTags to avoid code duplication: https://github.com/owncloud/core/blob/master/lib/repair/cleantags.phpmaybe later...Even though this solves the issue in a "brutal" manner by simply deleting ALL orphaned shares it feels hacky.
I could add code to find all child elements but that would take more time.
@DeepDiver1975 @icewind1991