After changing username URL still redirects to old route
Steps to reproduce:
- Go to your profile and change your username.
- If you try to visit your profile now with your old username it redirects you to the new name. Example: https://gitlab.com/toon redirects to https://gitlab.com/toon_idle
If a new user tries to claim the username which is now available after the rename they get the following error.
Username change failed - Namespace route path toon has been taken
before. Please use another one. Namespace route is invalid. Namespace
path toon has been taken before. Please use another one
Things to check. Redirect still present in the RedirectRoutes
table.
RedirectRoute.find_by_path("toon")
=> #<RedirectRoute id: 229748, source_id: 214011, source_type: "Namespace", path: "toon", created_at: "2018-01-03 05:41:15", updated_at: "2018-01-03 05:41:15", permanent: true>
Route.find_by_path("toon_idle")
=> #<Route id: 220670, source_id: 214011, source_type: "Namespace", path: "toon_idle", created_at: nil, updated_at: "2018-01-03 05:41:14", name: "toon_idle">
ZD tickets:
- https://gitlab.zendesk.com/agent/tickets/86315
- https://gitlab.zendesk.com/agent/tickets/83960
- https://gitlab.zendesk.com/agent/tickets/89131
Design
After clicking Update username
button, a modal shows up and tell users how the redirects would work.
Copy:
You are going to change the username **hazel** to **hazelyang**. Profile and projects will be redirected to the hazel namespace but this redirect will expire until the hazel namespace is registered by another user or group. Please update your Git repository remotes as soon as possible.
Edited by Hazel Yang