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

Keep shares when deleting shared folders #15282

Merged
merged 3 commits into from
Apr 9, 2015

Conversation

PVince81
Copy link
Contributor

The share entries will be linked with the fileid while they are kept in
the trashbin.

In the future a background just will scrape orphaned shares and delete
them.

(implementing a "new" feature by just deleting code!)

@PVince81
Copy link
Contributor Author

This will make it possible to keep shares when restoring files from the trashbin.
Please note that it will not work with external storages because in that case the fileid is not kept.

@karlitschek
Copy link
Contributor

as discussed 👍

@karlitschek
Copy link
Contributor

@schiesbn @DeepDiver1975 who can help to review this?�

@DeepDiver1975 DeepDiver1975 added this to the 8.1-current milestone Mar 31, 2015
@PVince81
Copy link
Contributor Author

PVince81 commented Apr 8, 2015

This cannot be reviewed yet, the other part #14676 must be merged first, else it won't work.

@PVince81
Copy link
Contributor Author

PVince81 commented Apr 8, 2015

@jnfrmarks small heads up for this "feature"

@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

I'll rebase this now that the blocking ticket was merged.

The share entries will be linked with the fileid while they are kept in
the trashbin.

In the future a background just will scrape orphaned shares and delete
them.
@PVince81 PVince81 force-pushed the keepsharerelationshipondelete branch from c2ca08b to 4613022 Compare April 9, 2015 08:21
@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

How nice, removing code doesn't break any unit tests, maybe there weren't any for that case in the first place.

Please review @DeepDiver1975 @LukasReschke @nickvergessen @MorrisJobke

To test:

  1. Share a file or folder with another user
  2. Delete the shared file/folder
  3. Restore it from trash
  4. Reload the page (to refresh the cached shares)
  5. See that the file/folder are still shared

Then: same as 2 but delete the parent folder of the shared file/folder.

@MorrisJobke
Copy link
Contributor

Tested and works. Also the shares are not available for the time they are in the trashbin. 👍

* @param string $path
*/
private static function removeShare($path) {
$fileSource = self::$toRemove[$path];
Copy link
Contributor

Choose a reason for hiding this comment

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

declaration of $toRemove at the top is no longer needed and can be removed too

@schiessle
Copy link
Contributor

beside the comment above 👍

@DeepDiver1975
Copy link
Member

nice - the orphant tests are failing again:

Test Result (2 failures / +2)

    Test\BackgroundJob\DeleteOrphanedSharesJobTest.testClearShares
    Test\BackgroundJob\DeleteOrphanedSharesJobTest.testKeepNonFileShares

@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

Weeeeird. I'll check that again locally (tests ran for me before I pushed)

@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

Grrrr works locally even when merged with master.

@owncloud-bot retest this please

@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

Maybe the test order was different and somehow the trashbin didn't get disabled properly for those tests

@scrutinizer-notifier
Copy link

A new inspection was created.

@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

Let's hope this can help: 5803a1f

According to @schiesbn, disabling the trashbin app might not be enough, stuff might still be registered.

@ghost
Copy link

ghost commented Apr 9, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11372/
🚀 Test PASSed.🚀
chuck

@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

@DeepDiver1975 works now.

This needs a second reviewer. Thanks.

@MorrisJobke
Copy link
Contributor

@PVince81 My 👍 still applies. It works as planned here

PVince81 pushed a commit that referenced this pull request Apr 9, 2015
Keep shares when deleting shared folders
@PVince81 PVince81 merged commit 2865f09 into master Apr 9, 2015
@PVince81 PVince81 deleted the keepsharerelationshipondelete branch April 9, 2015 16:10
@PVince81
Copy link
Contributor Author

PVince81 commented Apr 9, 2015

I'll update the wiki page with this new "feature"

@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants