-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dav): Move DAV app to non deprecated event dispatcher #39190
fix(dav): Move DAV app to non deprecated event dispatcher #39190
Conversation
$user = $event->getSubject(); | ||
/** @var SyncService $syncService */ | ||
$syncService = $container->query(SyncService::class); | ||
$syncService->updateUser($user); | ||
}); | ||
|
||
|
||
$dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateShares', function (GenericEvent $event) use ($container) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$dispatcher->addListener('\OCP\Calendar\Resource\ForceRefreshEvent', $eventHandler); | ||
$dispatcher->addListener('\OCP\Calendar\Room\ForceRefreshEvent', $eventHandler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find ForceRefreshEvent
as a search term in our github org, apart from this occurance here. I assume there were plans that changed on the way, so I think this is dead code and I just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also in #35388 :)
@@ -227,40 +224,26 @@ public function registerHooks(HookManager $hm, | |||
} | |||
}); | |||
|
|||
$dispatcher->addListener('OC\AccountManager::userUpdated', function (GenericEvent $event) use ($container) { | |||
$dispatcher->addListener('OC\AccountManager::userUpdated', function ($event) use ($container) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what type is the event now? can it be hinted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still GenericEvent, but then Psalm complains because the event listener does not consume IEvent. Removing silences psalm and makes it work. The actual fix again is creating and only listening to typed events, but time....
Signed-off-by: Joas Schilling <coding@schilljs.com>
The legacy event was removed in 4bb31c0 Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
a4939c0
to
e1d4b82
Compare
$syncService = $container->query(SyncService::class); | ||
$syncService->updateUser($user); | ||
$dispatcher->addListener('OC\AccountManager::userUpdated', function ($event) use ($container) { | ||
if ($event instanceof GenericEvent) { |
Check notice
Code scanning / Psalm
DocblockTypeContradiction
if ($event instanceof GenericEvent) { | ||
$user = $event->getSubject(); | ||
/** @var SyncService $syncService */ | ||
$syncService = $container->query(SyncService::class); |
Check notice
Code scanning / Psalm
DeprecatedMethod
One step closer for #38546
Checklist