{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/25113","repository_url":"https://api.github.com/repos/owncloud/core","labels_url":"https://api.github.com/repos/owncloud/core/issues/25113/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/25113/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/25113/events","html_url":"https://github.com/owncloud/core/pull/25113","id":160359999,"number":25113,"title":"Group shares with same source and target","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/2%20-%20Developing","name":"2 - Developing","color":"ededed"},{"url":"https://api.github.com/repos/owncloud/core/labels/backport-request","name":"backport-request","color":"006b75"},{"url":"https://api.github.com/repos/owncloud/core/labels/feature:sharing","name":"feature:sharing","color":"d4c5f9"},{"url":"https://api.github.com/repos/owncloud/core/labels/regression","name":"regression","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"assignees":[{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/76","html_url":"https://github.com/owncloud/core/milestones/9.2","labels_url":"https://api.github.com/repos/owncloud/core/milestones/76/labels","id":1632230,"number":76,"title":"9.2","description":null,"creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":468,"closed_issues":41,"state":"open","created_at":"2016-03-09T07:18:43Z","updated_at":"2016-07-12T10:30:21Z","due_on":null,"closed_at":null},"comments":24,"created_at":"2016-06-15T07:55:41Z","updated_at":"2016-07-12T13:32:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/25113","html_url":"https://github.com/owncloud/core/pull/25113","diff_url":"https://github.com/owncloud/core/pull/25113.diff","patch_url":"https://github.com/owncloud/core/pull/25113.patch"},"body":"Fixes #24575\r\n\r\nNote that this is a very limited solution and eventually we want smarter\r\nmerging!\r\n\r\nTODO:\r\n- [x] Add intergration tests\r\n- [x] Check if permissions are properly accumulated\r\n- [ ] Check if javascript needs to be fixed\r\n\r\nCC: @PVince81 @jonasheinisch"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/232048022","html_url":"https://github.com/owncloud/core/pull/25113#issuecomment-232048022","issue_url":"https://api.github.com/repos/owncloud/core/issues/25113","id":232048022,"user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T13:32:25Z","updated_at":"2016-07-12T13:32:25Z","body":"Working on the repair steps now.\r\n\r\nI find the hardest part is to identify which to adjust and which to leave alone.\r\n\r\nThis is on 9.0: when share with group1, group2 and user1 (user1 is in group1 and group2)\r\n```\r\nMariaDB [owncloud]> select * from oc_share order by item_source, uid_owner, stime;\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+---------------+-------------+------------+----------+------------+-------+-----------+\r\n| id | share_type | share_with | uid_owner | uid_initiator | parent | item_type | item_source | item_target | file_source | file_target   | permissions | stime      | accepted | expiration | token | mail_send |\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+---------------+-------------+------------+----------+------------+-------+-----------+\r\n|  1 |          1 | group1     | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test         |          31 | 1468329809 |        0 | NULL       | NULL  |         0 |\r\n|  6 |          2 | user1      | admin     | admin         |      1 | folder    | 9           | NULL        |           9 | /test (2)     |          31 | 1468329809 |        0 | NULL       | NULL  |         0 |\r\n|  2 |          1 | group2     | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test         |          31 | 1468329812 |        0 | NULL       | NULL  |         0 |\r\n|  3 |          2 | user1      | admin     | admin         |      2 | folder    | 9           | NULL        |           9 | /test (2) (2) |          31 | 1468329812 |        0 | NULL       | NULL  |         0 |\r\n|  5 |          0 | user1      | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test         |          31 | 1468329916 |        0 | NULL       | NULL  |         0 |\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+---------------+-------------+------------+----------+------------+-------+-----------+\r\n```\r\n\r\nAnd here is when created on this branch:\r\n```\r\nMariaDB [owncloud]> select * from oc_share order by item_source, uid_owner, stime;\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+-------------+-------------+------------+----------+------------+-------+-----------+\r\n| id | share_type | share_with | uid_owner | uid_initiator | parent | item_type | item_source | item_target | file_source | file_target | permissions | stime      | accepted | expiration | token | mail_send |\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+-------------+-------------+------------+----------+------------+-------+-----------+\r\n|  7 |          1 | group1     | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test       |          31 | 1468330088 |        0 | NULL       | NULL  |         0 |\r\n|  8 |          1 | group2     | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test       |          31 | 1468330091 |        0 | NULL       | NULL  |         0 |\r\n|  9 |          0 | user1      | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test       |          31 | 1468330095 |        0 | NULL       | NULL  |         0 |\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+-------------+-------------+------------+----------+------------+-------+-----------+\r\n```\r\n\r\nHowever, it could happen that the user decided to rename (also on this branch):\r\n```\r\nMariaDB [owncloud]> select * from oc_share order by item_source, uid_owner, stime;\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+---------------+-------------+------------+----------+------------+-------+-----------+\r\n| id | share_type | share_with | uid_owner | uid_initiator | parent | item_type | item_source | item_target | file_source | file_target   | permissions | stime      | accepted | expiration | token | mail_send |\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+---------------+-------------+------------+----------+------------+-------+-----------+\r\n|  7 |          1 | group1     | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test         |          31 | 1468330088 |        0 | NULL       | NULL  |         0 |\r\n| 10 |          2 | user1      | admin     | admin         |      7 | folder    | 9           | NULL        |           9 | /test renamed |          31 | 1468330088 |        0 | NULL       | NULL  |         0 |\r\n|  8 |          1 | group2     | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test         |          31 | 1468330091 |        0 | NULL       | NULL  |         0 |\r\n| 11 |          2 | user1      | admin     | admin         |      8 | folder    | 9           | NULL        |           9 | /test renamed |          31 | 1468330091 |        0 | NULL       | NULL  |         0 |\r\n|  9 |          0 | user1      | admin     | admin         |   NULL | folder    | 9           | NULL        |           9 | /test renamed |          31 | 1468330095 |        0 | NULL       | NULL  |         0 |\r\n+----+------------+------------+-----------+---------------+--------+-----------+-------------+-------------+-------------+---------------+-------------+------------+----------+------------+-------+-----------+\r\n```\r\n\r\nThis looks very close to the bogus case that needs to be repaired.\r\n\r\nSo for now the idea is to first gather all shares with type \"2\" (children of group shares) and check whether they all have the same \"target\". If they do, it means it was a legitimate rename.\r\nHowever, if the target is inconsistent, then set the target to the one of the parent.\r\n"}}
{"actor":{"display_login":"PVince81"}}