Trigger eventdispatcher for federated share#29511
Conversation
Codecov Report
@@ Coverage Diff @@
## master #29511 +/- ##
============================================
+ Coverage 61.63% 61.69% +0.06%
Complexity 17477 17477
============================================
Files 1044 1044
Lines 57693 57701 +8
============================================
+ Hits 35557 35599 +42
+ Misses 22136 22102 -34
Continue to review full report at Codecov.
|
877576b to
15fb709
Compare
There was a problem hiding this comment.
Updated with injection.
There was a problem hiding this comment.
I don't think the event name should match the class + method names.
As an event consumer, I'd rather expect the event name to be understandable and meaningful: what is this event about on a high-level ? The namespace also doesn't need to be one of a class. I think if we keep it to OCA\FederatedFileSharing::eventName it would be fine.
There was a problem hiding this comment.
Updated the event names:
\OCA\FederatedFileSharing::local_shareReceived\OCA\FederatedFileSharing::remote_shareReceived
80ef9ff to
47b780d
Compare
|
@PVince81 There is one issue which is bugging me. The Notifier is the place where I found the local fed shares are informed to the recipient. While doing manual testing, I found that lets say user delays to accept the fed share, then the logger keeps sending the message about arrival of share until the recipient accepts. I am pretty sure the admins wont be happy with this behaviour. |
|
@sharidas hmm, can you dig into the root cause of this ? Maybe there is some pinging/polling happening. Somehow I don't remember such mechanism to exist so let's find out whether it's some kind of bug. |
47b780d to
d135fca
Compare
|
There was an app, notification which was polling in my env. When I removed the app, and then refreshed the browser, I get the logs for received local fed share. No more repeated messages. |
|
@sharidas we need to find a way to log the message only once even when notifications app is enabled. I still don't get why the notification app would trigger such event. Maybe the event trigger needs to be moved to a different more accurate location ? |
d135fca to
33b7ea0
Compare
|
Verified this change as below:
|
PVince81
left a comment
There was a problem hiding this comment.
👍 looks good
I've restarted the Drone build
There was a problem hiding this comment.
I guess we don't have more detailed info for the hook ?
There was a problem hiding this comment.
Updated with more details. I guess this should be enough.
33b7ea0 to
52e0978
Compare
| $event = new GenericEvent(null, ['name' => $name, 'targetuser' => $sharedByFederatedId, | ||
| 'owner' => $owner, 'sharewith' => $shareWith, | ||
| 'sharedby' => $sharedBy, 'remoteid' => $remoteId]); | ||
| \OC::$server->getEventDispatcher()->dispatch('\OCA\FederatedFileSharing::remote_shareReceived', $event); |
There was a problem hiding this comment.
inject the event dispatcher ?
fdc8506 to
ff0c834
Compare
Trigger event dispatcher for federated share receiving. Signed-off-by: Sujith H <sharidasan@owncloud.com>
ff0c834 to
54de0bf
Compare
|
@sharidas please backport asap |
|
The backport PR is already merged to stable 10. |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Trigger event dispatcher for federated share
receiving.
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
Change to trigger event dispatcher event for federated share receive.
Related Issue
Motivation and Context
This will help users to log events for fed share receive.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: