{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/16321","labels_url":"https://api.github.com/repos/owncloud/core/issues/16321/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/16321/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/16321/events","html_url":"https://github.com/owncloud/core/pull/16321","id":75954522,"number":16321,"title":"Start of interface for the new sharing code","user":{"login":"rullzer","id":45821,"avatar_url":"https://avatars.githubusercontent.com/u/45821?v=3","gravatar_id":"","url":"https://api.github.com/users/rullzer","html_url":"https://github.com/rullzer","followers_url":"https://api.github.com/users/rullzer/followers","following_url":"https://api.github.com/users/rullzer/following{/other_user}","gists_url":"https://api.github.com/users/rullzer/gists{/gist_id}","starred_url":"https://api.github.com/users/rullzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rullzer/subscriptions","organizations_url":"https://api.github.com/users/rullzer/orgs","repos_url":"https://api.github.com/users/rullzer/repos","events_url":"https://api.github.com/users/rullzer/events{/privacy}","received_events_url":"https://api.github.com/users/rullzer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/1%20-%20To%20develop","name":"1 - To develop","color":"ededed"},{"url":"https://api.github.com/repos/owncloud/core/labels/sharing","name":"sharing","color":"e102d8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-13T11:36:05Z","updated_at":"2015-05-13T12:22:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/16321","html_url":"https://github.com/owncloud/core/pull/16321","diff_url":"https://github.com/owncloud/core/pull/16321.diff","patch_url":"https://github.com/owncloud/core/pull/16321.patch"},"body":"So as promised a start of the sharemanger to start moving the share code. A little later than planned (and less complete) but I think it is important that we start this discussion now.\r\n\r\nThis issue is to discuss the rewrite of the sharing stuff so we can do it right and in a way multiple people properly understand.\r\n\r\n\r\n## Current state\r\nRight now there is 1 big file that does a lot. There are several functions that are way to big and complex to understand them completely. Several functions interact in complex and often (at least to me) unintuitive ways.\r\n\r\nThis has all lead to a state where most people are afraid to touch the code. And situations are often to complex that it is even hard to write proper unit tests.\r\n\r\n## The new way\r\nFirst of all we should split the actual share and the share manager. The IShare is a pretty straight forward interface which allows manipulation of the share. This is basically a simple wrapper around the oc_share table.\r\n\r\nThe share manager is the place where the complex stuff happens. There will be functions that take a long time to properly rewrite (resharing is a bitch). But the current state is not really maintainable.\r\n\r\n### Database changes\r\nIt would be nice if we could do run both API's next to each other. So app devs etc have time to migrate to the new API. This has strong preference.\r\n\r\n### Reduce public API functions\r\nThe number of public API functions should be limited. It is better to have some functions that return a little bit to much info than to have 4 functions that all return slightly similar results. \r\n\r\nA way to deal with this could be to have some kind of shareFilters that could be passed to the functions. If we provide a basic set of filter and an share Filter interface probably most devs could easily get the info they want. That way it is not easy to add a specific filter for the info you want while ensure that we only have to worry about 1 codepath to provide the correct result.\r\n\r\n\r\n# Discussion\r\nAll feedback is appreciated. Are there functions missing? What new functionality that we can't implement currently should we also consider here. What is some stuff we would like to do in the future so we can keep that in mind when making decisions.\r\n\r\nCC: @DeepDiver1975 @schiesbn @LukasReschke @MorrisJobke @PVince81 \r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/101646317","html_url":"https://github.com/owncloud/core/pull/16321#issuecomment-101646317","issue_url":"https://api.github.com/repos/owncloud/core/issues/16321","id":101646317,"user":{"login":"owncloud-bot","id":2709266,"avatar_url":"https://avatars.githubusercontent.com/u/2709266?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud-bot","html_url":"https://github.com/owncloud-bot","followers_url":"https://api.github.com/users/owncloud-bot/followers","following_url":"https://api.github.com/users/owncloud-bot/following{/other_user}","gists_url":"https://api.github.com/users/owncloud-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud-bot/subscriptions","organizations_url":"https://api.github.com/users/owncloud-bot/orgs","repos_url":"https://api.github.com/users/owncloud-bot/repos","events_url":"https://api.github.com/users/owncloud-bot/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud-bot/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T12:22:02Z","updated_at":"2015-05-13T12:22:02Z","body":"\nRefer to this link for build results (access rights to CI server needed): \nhttps://ci.owncloud.org//job/pull-request-analyser-ng-simple/12323/\n:rocket: Test PASSed.:rocket:\n![chuck](https://cloud.githubusercontent.com/assets/1005065/6865211/d99978f2-d46b-11e4-9c1d-66f21a737511.jpg)"}}