Skip to content

Conversation

@mikaelh
Copy link
Contributor

@mikaelh mikaelh commented Feb 7, 2019

This is a workaround for broken resharing issue in issue #14082

Partly introduced in PR #12626

  1. in createShareActivity() - mismatch for arguments on second $this->publishActivity() (merging alignment problem/typo)
  2. delete() function now also call createShareActivity()

Problem 1 causes an exception to be thrown because of incorrect arguments

Problem 2 is a bit more tricky
The issue is that the share object is initialized differently when passed to createShareActivity().
Via ShareAPIController:deleteShare() and $this->getShareById($id) the Node in the share object is initiated on the owner of the share.
Via ShareAPIController:createShare() the Node in the share object is instantiated based on the logged in user (or share initiator).

This means that createShareActivity() is called with the same IShare object but the node is pointing either to owner or initiator depending on if it is a create or delete.

This fix is a quick workaround to cope with this issue, even though the root cause need to be investigated.

@nickvergessen
Copy link
Member

Should be fixed with #14083

@nickvergessen
Copy link
Member

nickvergessen commented Feb 8, 2019

Closing as per above, thanks for your work anyway!
And welcome to the Nextcloud community 🎉

@mikaelh
Copy link
Contributor Author

mikaelh commented Feb 13, 2019

Hi @nickvergessen
Thanks! :)

However, IMHO the fix in #14083 just mask the actual issue in publishActivity()
When unsharing, it tries to do a getRelativePath mixing the userFolder and ownerFolder which fails and return null.

It works when creating a share because createShare() seem to be broken and pass the initiator Path while deleteShare() passes the owner Path to publishActivity()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants