Skip to content
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

WSOD - User with delegates can't be removed - missing meaningful error message in UI #14133

Open
AlfredSK opened this issue May 8, 2024 · 1 comment
Labels

Comments

@AlfredSK
Copy link

AlfredSK commented May 8, 2024

  • [X ] I have searched open and closed issues for duplicates

Bug Description

When an administrator/moderator is trying to delete a user account with delegates the account deletion fails with a WSOD - HTTP error 500. There is no meaningful info/popup message why this account couldn't be removed.

In my case the account has been blocked some time ago. Now I want to delete it. But I'm not sure if the blocked state of the account has any impact on the behavior/error.

In Friendica's application log this message appears when the WSOD happens:

Uncaught Exception RuntimeException: "User with delegates can't be removed, please remove delegate users first" at .../src/Model/User.php line 1770 
{"exception":"RuntimeException: User with delegates can't be removed, please remove delegate users first in .../src/Model/User.php:1770
Stack trace:
#0 .../src/Module/Moderation/Users/Blocked.php(81): Friendica\\Model\\User::remove()
#1 .../src/BaseModule.php(250): Friendica\\Module\\Moderation\\Users\\Blocked->content()
#2 .../src/App.php(714): Friendica\\BaseModule->run()
#3 .../index.php(55): Friendica\\App->runFrontend()
#4 {main}"} - 
{"file":null,"line":null,"function":null,"request-id":"663b4e324c109","stack":"ErrorHandler::handleException (128), ErrorHandler::Friendica\\Core\\Logger\\Handler\\{closure}","uid":"809aa8","process_id":90405}

Steps to Reproduce

  1. find an account with delegates
  2. try to delete that account
  3. exception error with WSOD

Actual Result:
WSOD

Expected Result:
No WSOD, but a proper error page or go back to the previous page (in my case for example (https://libranet.de/moderation/users/blocked?o=last-activity) and show a popup/info-bubble with an meaningful message why the account couldn't be removed.

Platform Info

Friendica Version:
2024.06-dev

Friendica Source:
git

PHP version:
8.1

SQL version:
MariaDB 10.6

@AlfredSK AlfredSK added the Bug label May 8, 2024
@MrPetovan
Copy link
Collaborator

This exception was introduced to prevent regular accounts to self-delete and lose access to their delegated accounts. It looks like we need to carve an exception for admin deletion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants