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
Attempting to create a team with the URL of an existing team shows the wrong error message #26841
Comments
Can you assign me? |
@hmhealey I was trying to reproduce this bug accordingly to your description and for me it shows a different error message. I added a screenshot of the message at the bottom. Honestly, for me it looks quite friendly. What do you think? Can you also tell me what version of Mattermost are you using here? I'm using Mattermost Team Edition with the latest master branch. |
I also saw the "This URL is taken" error message when I just tested on my admin account, but I see the incorrect error message on my other account, so there's something else going on here. It seems like either there's something here caused by incorrect permissions or perhaps it has to do with being on that other team. Hopefully that gives you something to work off of, but let me know if neither of those end up being the issue, and I can take another look. Also, if it still matters, I'm on the latest master branch as well |
@hmhealey thanks for a hint about permissions. I found a way to recreate this behavior. Here are the steps to reproduce the bug:
Now I'm trying to fix the issue. |
@hmhealey I believe I've identified the code responsible for this issue. The I'm curious about this because the Here is the link to this function: mattermost/server/channels/api4/team.go Line 1237 in 8348aca
|
Looking back further, that permission check goes back to #12130 which is to fix a minor security issue where guest users could figure out if a team exists using that endpoint when they shouldn't have been able to. Unfortunately, that makes it so that the Since I don't think we can change the API to make that more helpful, I guess the next best thing would be to detect the "must call update" error in the frontend and show a nicer error message to the end user. There's an error ID that you could use for that. How does that sound? Also, CC @jespino in case he has any ideas for how to make that API more useful again for non-admin, non-guest users |
@hmhealey Sure. The error on the frontend side comes from this line of code where we are calling the endpoint to create a team: mattermost/webapp/channels/src/components/create_team/components/team_url/team_url.tsx Line 169 in 978f335
I'm just not sure what should be the error message here. Wouldn't |
That's a good point. I guess the difference here is that the Because of that, I think it's fine to still use "A team with this URL already exists" in this case |
Repro steps:
Observed: The error message reads “Must call update for existing team.”
Expected: The error message reads “A team with that URL already exists.”
To do this, we should have the web app intercept the existing error message by its ID and show the more friendly error message instead.
If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
JIRA: https://mattermost.atlassian.net/browse/MM-57877
The text was updated successfully, but these errors were encountered: