Skip to content

[Sharing 2.0] create share - #20773

Merged
DeepDiver1975 merged 11 commits into
masterfrom
share2.0_create
Jan 7, 2016
Merged

DeepDiver1975 merged 11 commits into
masterfrom
share2.0_create

Conversation

@rullzer

@rullzer rullzer commented Nov 26, 2015

Copy link
Copy Markdown
Contributor

Creating a share with the new sharing code.

It sets the new uid_fileonwer column right away.

TODO:

  • Finish unit tests for more coverage
  • Inspect what might break
  • New integration tests?
  • HOOKS
    • Preshare
    • postshare
    • password
  • Generate new target (do on initmount)
  • Target should have default share directory

@rullzer rullzer added this to the 9.0-current milestone Nov 26, 2015
@rullzer
rullzer force-pushed the share2.0_create branch 3 times, most recently from 8d04722 to 28961d0 Compare November 27, 2015 08:28
@rullzer

rullzer commented Nov 27, 2015

Copy link
Copy Markdown
Contributor Author

So we need to properly generate targets. The question is where do we want to do this?

Currently there is this whole bounching around. From share/share.php => share/helper.php => files_sharing... => files_sharing/lib/helper.php etc

I think it would be best to handle this in the share provider. Since there it can be decided what to do. Since for example for federated sharing and maybe custom share providers there might be no (or a different) need when generating targets.

@schiesbn what do you think?

@schiessle

Copy link
Copy Markdown
Contributor

Once a share gets created I would simply add the path of the owner as target and check for name collisions once the share gets mounted for the recipient and adjust the target then. This should have a much better performance instead of creating for all recipients (which can be a lot if you think about group shares) a unique target during the share operation.

Maybe, to improve performance during mount we could add a flag to the share to indicate if it is already a unique target or not so that we do the check for every share only once and not during every mount.

@rullzer

rullzer commented Nov 27, 2015

Copy link
Copy Markdown
Contributor Author

OK agreed :)

@rullzer

rullzer commented Nov 27, 2015

Copy link
Copy Markdown
Contributor Author

Seems the current tests are failing because we do not copy over the skeleton dir properly if there is a mountpoint for that file in place.

@rullzer

rullzer commented Nov 27, 2015

Copy link
Copy Markdown
Contributor Author

The current failing OCS test is caused by not creating explicit reshares of files anymore.

@schiessle

Copy link
Copy Markdown
Contributor

Once a share gets created I would simply add the path of the owner as target and check for name collisions once the share gets mounted for the recipient and adjust the target then.

Just to clarify this part to make sure that we don't miss something. We shouldn't set the full owner path as target by default but only the file/folder name of the shared file/folder concatenated with the default target for shares (default is the root folder but it can be changed in config.php)

@rullzer

rullzer commented Nov 27, 2015

Copy link
Copy Markdown
Contributor Author

Just to clarify this part to make sure that we don't miss something. We shouldn't set the full owner path as target by default but only the file/folder name of the shared file/folder concatenated with the default target for shares (default is the root folder but it can be changed in config.php)

Yes, I now just take the name of the file/folder. Should add the default folder. But indeed not the whole path.

@rullzer
rullzer force-pushed the share2.0_create branch 2 times, most recently from f8b364b to cbc6845 Compare December 1, 2015 07:45
@rullzer

rullzer commented Dec 1, 2015

Copy link
Copy Markdown
Contributor Author

Target is now constructed with share_dir

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@rullzer please rebase to get latest changes regarding the ocs api test execution in - maybe we see something of value in the logs why this breaks .... THX

@rullzer
rullzer force-pushed the share2.0_create branch 2 times, most recently from ca2c133 to f3e125d Compare December 1, 2015 09:48
@rullzer rullzer mentioned this pull request Dec 1, 2015
35 of 43 tasks
@rullzer

rullzer commented Dec 1, 2015

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 rebased.

The only failing test I see is the one where we check for reshares. This is disabled for now. And we should be able to renable that once we implement getShares in the new code. Since that will list all reshares based on who owns the file etc.

@rullzer

rullzer commented Dec 1, 2015

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 @schiesbn @nickvergessen @PVince81 I know more test coverage is needed here. But I'd appriciate if you can already look at this PR. Especially the manager part (that holds the most 'logic'). And see if I'm missing something critical.

Comment thread apps/files_sharing/api/share20ocs.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not really necessary

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes, try-catch block below should already catch broken date strings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed removed

@rullzer

rullzer commented Jan 5, 2016

Copy link
Copy Markdown
Contributor Author

Ok, so apparently we threw a 403 by default. This is fixed now... now trying to get all places we throw something else...

@rullzer

rullzer commented Jan 5, 2016

Copy link
Copy Markdown
Contributor Author

Ok, I think smashbox should be happier now.
@nickvergessen if you have time :)

@nickvergessen

Copy link
Copy Markdown
Contributor

Smashed it, and it passed on owncloud/smashbox#140 now.

@rullzer
rullzer force-pushed the share2.0_create branch 2 times, most recently from 90a470b to d32bae8 Compare January 6, 2016 10:40
@jospoortvliet

Copy link
Copy Markdown

\o/ :joy: :tada:

@rullzer

rullzer commented Jan 7, 2016

Copy link
Copy Markdown
Contributor Author

Now that smashbox is passing as well. Please review once more. @schiesbn @nickvergessen @DeepDiver1975

@schiessle

Copy link
Copy Markdown
Contributor

all tests passed and code looks good at first sight, so let's get this in to move forward 👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor

I can easily fix the smashbox assertion, but we need to be sure that the API change is intended

no api change!

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

DeepDiver1975 added a commit that referenced this pull request Jan 7, 2016
@DeepDiver1975
DeepDiver1975 merged commit 601457d into master Jan 7, 2016
@DeepDiver1975
DeepDiver1975 deleted the share2.0_create branch January 7, 2016 13:57
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 8, 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.

5 participants