Summary
Permanently deleted a user account, went to rename another account to same username, account shows as “deactivated” in the UI.
Steps to reproduce
Ensure ServiceSettings.EnableAPIUserDeletion is set to true in server configuration.
Have test and test1 accounts, both active.
Delete account named test using API with parameter permanent=true
Rename account named test1 to test using API
Attempt to direct-message user in UI.
Expected behavior
If a user account has been permanently deleted, its username should be able to be used again, especially since the internal ID for the user account is 26 random alphanumeric characters.
this is actually “just” a caching issue of the WebApp. After you deleted the user, it will still show up in the sidebar and if you had a DM channel open with it, you will see the DM channel being archived (since the user is deactivated) and you will still be able to find the user in the search, but if you CTRL/Cmd-shift-r(eload) the page, you will see that the username is free again, at least during my tries to reproduce that.