From c432f48d5b72f5e71f9b220b61b2a2278915d18d Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 20 Sep 2026 11:04:14 +0200 Subject: [PATCH] chore(hooks): prune allow-list entries for signals no longer emitted Drops rollback, pre/post_passwordReset, logout, changeUser, post_read and the OCP\Config js entry, so connecting to them fails loudly instead of silently never firing. post_read was never emitted at all: runHooks only emits read in its pre branch, so ViewTest no longer connects it either. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Ferdinand Thiessen --- lib/private/legacy/OC_Hook.php | 7 ------- tests/lib/Files/ViewTest.php | 15 +++++++++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/private/legacy/OC_Hook.php b/lib/private/legacy/OC_Hook.php index 06c300f9d7ccc..4b5526771178a 100644 --- a/lib/private/legacy/OC_Hook.php +++ b/lib/private/legacy/OC_Hook.php @@ -41,7 +41,6 @@ class OC_Hook { [Filesystem::CLASSNAME, Filesystem::signal_post_init_mountpoints], [Filesystem::CLASSNAME, 'umount'], [Filesystem::CLASSNAME, 'post_umount'], - [Filesystem::CLASSNAME, 'post_read'], [Share::class,'share_link_access'], [Share::class,'pre_unshare'], [Share::class,'post_unshare'], @@ -60,12 +59,9 @@ class OC_Hook { ['OCP\Trashbin','preDelete'], ['OCP\Trashbin','preDeleteAll'], ['OCP\Trashbin','deleteAll'], - ['OCP\Versions','rollback'], ['OCP\Versions','preDelete'], ['OCP\Versions','delete'], [OC_User::class,'post_login'], - [OC_User::class,'logout'], - [OC_User::class,'changeUser'], ['OC\User','assignedUserId'], ['OC\User','preUnassignedUserId'], ['OC\User','postUnassignedUserId'], @@ -74,9 +70,6 @@ class OC_Hook { ['Scanner','removeFromCache'], ['Scanner','addToCache'], ['Scanner','correctFolderSize'], - ['OCP\Config','js'], - ['OC\Core\LostPassword\Controller\LostController','post_passwordReset'], - ['OC\Core\LostPassword\Controller\LostController','pre_passwordReset'], /* Only used by tests */ ['LegacyHookTest', 'error'], ['LegacyHookTest', 'hint'], diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 9fac960c09f57..b5a304cd0b234 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -2582,12 +2582,15 @@ function () use ($view, $path, $onMountPoint, &$lockTypePost): void { $eventHandler, 'preCallback' ); - Util::connectHook( - Filesystem::CLASSNAME, - 'post_' . $hookType, - $eventHandler, - 'postCallback' - ); + // there is no post_read signal, read is only emitted before the operation + if ($hookType !== 'read') { + Util::connectHook( + Filesystem::CLASSNAME, + 'post_' . $hookType, + $eventHandler, + 'postCallback' + ); + } } }