Skip to content

Conversation

@MTGap
Copy link
Contributor

@MTGap MTGap commented Jul 8, 2013

This isn't ready to be merged yet, because this is only the backend changes. At this time I would just like a code review of the architecture. You can read this page to get a general overview: https://github.com/owncloud/core/wiki/Share-API

Besides all the new code, the largest change is storing multiple parent references for reshares because it is possible to share to the same user multiple times through group and user shares. By not referencing all parents of a reshare there were unexpected permission and unsharing issues.

This took so long, because I wrote unit tests for 'almost' all of the code. It is currently at 95.62% code coverage and the nice thing is that the tests are fast, all ~500 assertions. One test is failing because of the groups backend and is unrelated to the Share API.

Todo:

  • Update frontend to use new API and write acceptance tests for it
  • Update public links
  • Integrate with files
  • Integrate with contacts
  • Integrate with calendar
  • Integrate with encryption app
  • User hook listener
  • Group hook listener
  • Updater

I really want to kill all sharing bugs once and for all...

@MTGap
Copy link
Contributor Author

MTGap commented Jul 8, 2013

Copy link
Contributor

Choose a reason for hiding this comment

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

get_class() returns the namespace + classname without a leading \ (OC\Share\Shares) for consistency sake I think it's best to always have a leading \ for emitter scopes

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe using a more general scope like \OC\Share is better since the classname isn't consistence with the multiple sub classes that can exists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intention is to have it just be the classname, is there a function for just that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to have it based on the individual sub classes so you didn't have to listen to all sharing events and filter afterwards.

Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't a need to use the scope to distinguish the source that emitted the events, if you want to only listen to events from only one backend you can simple only attach the listeners to that one backend.

(also see my comments about making \OC\Share\Manager an emitter)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I'll just switch it to a general scope.

@DeepDiver1975
Copy link
Member

@MTGap What about the pubic api? Do you provide a compatibility layer?

@MTGap
Copy link
Contributor Author

MTGap commented Jul 8, 2013

@MTGap What about the pubic api? Do you provide a compatibility layer?

No, I see no need to do that, because I was the main person to integrate it with apps originally anyways. It will only cause more pain.

@DeepDiver1975
Copy link
Member

No, I see no need to do that,

Well - we have no clue on which and how many apps exist out there relying on the public api.
Breaking the API that way is very unkind and can cause many mad dev to scream at us.

Copy link
Contributor

Choose a reason for hiding this comment

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

if (method_exists($instance, $method)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer that the exception is thrown, because it shows that something is wrong.

@ghost
Copy link

ghost commented Aug 10, 2013

Test failed.
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/477/

@ghost
Copy link

ghost commented Aug 19, 2013

Test failed.
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/635/

@ghost
Copy link

ghost commented Aug 22, 2013

Test failed.
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/667/

@ghost
Copy link

ghost commented Aug 27, 2013

Test failed.
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/731/

@MTGap MTGap closed this Aug 29, 2013
@jancborchardt
Copy link
Member

Closed? @MTGap what’s up with this, any follow-up pull request?

@Niduroki
Copy link
Member

@MTGap: Seconding @jancborchardt's question.

@karlitschek
Copy link
Contributor

@Kondou-ger This branch is dead. We will start over for ownCloud 7 and improve sharing. But this time not with a complete rewrite that is 10x as big but with an iterative approach.

@DeepDiver1975 DeepDiver1975 deleted the share branch October 11, 2013 07:46
@lock lock bot locked as resolved and limited conversation to collaborators Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.