Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove storage wrappers when deleting the user storage
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and PVince81 committed Jun 10, 2022
commit 682cc2ea530c9c7ec0d1cd46da00c98ca8c05da0
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
namespace OC\Authentication\Listeners;

use OC\Files\Cache\Cache;
use OC\Files\Storage\Wrapper\Wrapper;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Files\Config\IMountProviderCollection;
Expand Down Expand Up @@ -56,6 +57,13 @@ public function handle(Event $event): void {
if (!$storage) {
throw new \Exception("User has no home storage");
}

// remove all wrappers, so we do the delete directly on the home storage bypassing any wrapper
while ($storage->instanceOfStorage(Wrapper::class)) {
/** @var Wrapper $storage */
$storage = $storage->getWrapperStorage();
}

$this->homeStorageCache[$event->getUser()->getUID()] = $storage;
}
if ($event instanceof UserDeletedEvent) {
Expand Down