Are usernames not unique anymore (3.5.0)?

Previously usernames had to be unique, which makes sense. But I noticed now when I’m calling UpdateAccountAsync, that I could use any username and on the admin I it showed multiple users with the same usernames.

Is this by design or are there some bug in the latest nakama version? We updated from 3.1.2 to 3.5.0.

Thanks!

@NixarnTowerPop Usernames are required to be unique and always will be. That hasn’t changed. You can see in the database schema that we require a unique index on the username column of the users table:

The display_name field of the user is not unique and is allowed to be the same across users in the game. Are you certain that you see users in the system with the same username? Can you run this query to check whether a username you see more than once is actually in-use by more than one user?

SELECT count(id) FROM users WHERE username = 'duplicate-username';

Thanks! Yeah that makes sense, but at the moment, looking at our admin, we’re able to have two identical usernames. I wanted the client to complain that the username was already taken, but wouldn’t get an exception, that’s when I looked into it. I’ll investigate on our side, I wonder if our test server has had that user table altered.

Edit: So apparently our lead dev wiped the database when updating to 3.5.X, but somehow old users still show on the console, so I wonder if it’s just some caching issue.

@NixarnTowerPop Thanks for the update. Want to open an issue about the view state in the Nakama Console to indicate that it may be cached incorrectly?

I’ll do some more investigating to confirm my suspicion and if it looks as if I’m correct I’ll open an issue. Thanks!

2 Likes