When deleting a user fails, the alert dialog did not pop up properly

AI-generated summary

pangbo reported a bug where the error dialog failed to appear when a user attempted to delete their own account via “Preferences” without having the necessary permissions. After reviewing the source code, pangbo suspected that the issue was due to a missing next call in the account.js controller. They tested this hypothesis in a development environment by modifying the code to include the next callback around the alert function, which successfully triggered the dialog. pangbo noted their unfamiliarity with Ember but believed the original code contained a definite bug. sam confirmed the issue was resolved in a subsequent pull request, linking to the fix in the Discourse GitHub repository.

In my recent test, I found that when the user fails to delete himself in the “Preferences”, the corresponding error dialog box does not pop up normally.

After reading the source code, I suspect that this line of code is missing a call to next.

I modified this line in development environment, like this
next(() => this.dialog.alert(I18n.t("user.delete_yourself_not_allowed")));
then I found that the dialog popped up normally.

I’m not very familiar with ember, so I don’t know if this modification is correct, but it seems that there must be a bug here

1 Like

fixed per:

1 Like