question

blindgoat avatar image
blindgoat asked

Is CustomId Guaranteed Unique?

We are using LoginWithCustomID and seeing inconsistent behavior. The docs say CustomId is unique, but it's unclear whether that uniqueness is enforced on the server. Our initial thoughts were that the uniqueness is enforced but then we ended up with two accounts with the same CustomId of "GettingStartedGuide" (from using the identical code from the Unity Getting Started Guide).

The first time we logged in with that CustomId, it created the account. The next few logins it just logged the user in and didn't create new accounts. Later, however, it created a new account with the exact same CustomId. When does the system know if it's the same user logging in vs a new user? Is uniqueness guaranteed on the server?

Obviously we wouldn't use simple things such as "GettingStartedGuide" as our ID.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

blindgoat avatar image blindgoat commented ·

D'oh, sorry. I correctly had it in the API & SDK Questions earlier but when I submitted the question it failed and I had to recreate the post. Apologies for not putting this in the correct spot.

0 Likes 0 ·
brendan avatar image brendan blindgoat commented ·

No worries - we fixed that.

1 Like 1 ·

1 Answer

·
comc avatar image
comc Deactivated answered

Yes it is unique. What was the error code you were getting back? You can see the reasons for the different error codes here:

https://api.playfab.com/documentation/Client/method/LoginWithCustomID

17 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

blindgoat avatar image blindgoat commented ·

Thanks comc. There isn't an error code - it made two users with the exact same customId in the database. Only after this did I add a username/email/password combo to the second user, as you'll see in the screenshot.

0 Likes 0 ·
player1.png (33.5 KiB)
player2.png (32.4 KiB)
blindgoat avatar image blindgoat commented ·

The system just created another user with the same CustomId without us changing the login code. We are working on testing the Title and Player Data so our client code is hitting those APIs, but it always makes the same login call to log the player in.

Now we have three users in the database with the CustomId of "GettingStartedGuide".

0 Likes 0 ·
brendan avatar image brendan blindgoat commented ·

The Custom ID is actually the Index (along with the Publisher ID) on the data table for Custom IDs, so it's not technically possible for there to be two accounts in the same Publisher ID with the same Custom ID. I just did a search on that table for the Custom ID "GettingStartedGuide" and confirmed that there aren't any instances of the same Publisher ID having two of that Custom ID. What is your Title ID, and what are the PlayFab IDs of the users, so that we can have a look?

0 Likes 0 ·
blindgoat avatar image blindgoat brendan commented ·

Title ID: AFF1

Publisher Player IDs: 83DBB4517FB8D2D5, 910C1E8A3817320B, 1B93F13AA3E7C798

0 Likes 0 ·
Show more comments
blindgoat avatar image blindgoat commented ·
PlayerID Master   PlayerID Title      CustomID           username
83DBB4517FB8D2D5 A190A41473B866E2 GettingStartedGuide      n/a
910C1E8A3817320B DD2A9D3DD5332AC4 GettingStartedGuide   blindgoat2
1B93F13AA3E7C798 33A46169C29AB1A6 GettingStartedGuide      n/a
52FE841E26C6872F C4D6A1D4BB678405 GettingStartedGuide   blindgoat3
6D72593E30D1A011 4D186F4F9C82C849 GettingStartedGuide2  blindgoat
BF9F1AC01354EB53 E2C8421F115F7F58 GettingStartedGuide3     n/a
CE0C692314FB80BF 26481F310243BD21 92D8874F81D12F6F         n/a
A41DD7BAD2D7514F BEAAFAA5831149B8 332254101E62BCF9         n/a

This is all the non-deleted accounts for TitleID AFF1. I grabbed these from the manually from the admin console.

0 Likes 0 ·
brendan avatar image brendan blindgoat commented ·

The point I was making is that what you are seeing is a bug in the Game Manager. There is only one player account with the Custom ID on it, such that you can log into it. The other accounts are showing that ID in the Game Manager, but do not have that ID. Until you unlink that account's Custom ID, or use the ForceLink option to change it to another account, it is impossible for another account to be created which "takes" that ID away from it.

I have literally tried LoginWithCustomId with the same ID ("GettingStartedGuide") hundreds of times, and cannot reproduce this. Do you mind if I try the call on your Title ID?

0 Likes 0 ·
blindgoat avatar image blindgoat brendan commented ·

Thanks Brendan. I hope it's clear I'm not trying to argue; the goal was to give you as much info as possible to help isolate the issue. I understand it's an issue in the Game Manager and was making it clear that on our side it shows 4 separate users with 4 separate pairs of Player Master and Title Player IDs. I wasn't sure if you could see the same thing on your side. Now I get that you see the same four players but only one of them really has that CustomID. Thanks!

Feel free to make any calls you want on our Title. If it helps, I don't think the issue has to do with calling anything hundreds of times since our Title only has ~11 total Players in its history and (I'd guess) fewer than a thousand total API calls. We'll continue reproduction efforts on Monday and let you know anything we think might be useful. Cheers!

0 Likes 0 ·
Show more comments
ma-lopez avatar image ma-lopez commented ·

Sorry, but you can reproduce this bug as many times as you want. Go to your player database and take one customId from any of them.

With this customID, go to your LoginWithCustomID example and try it, with this customID, and CreateAccount set to true.

Push Call API button, and in the results you'll see it's a newly created account. Any way, if you want, go to your players data again, and reload the data. You'll see you have a new player with the same customID that the one you duplicated.

0 Likes 0 ·
brendan avatar image brendan ma-lopez commented ·

So, I just opened up Postman, pulled up LoginWithCustomID, set CreateAccount to true, and entered a random GUID for my Custom ID.

I then ran that command 50 times in a row.

The first time, it created an account. Every other time, it logged into that account.

If you believe you're seeing something different, can you please provide the Title ID, Custom ID, and your exact repro steps?

0 Likes 0 ·
ma-lopez avatar image ma-lopez commented ·

Ok, I tried again and voilá, here are the pictures.

im1.jpgim2.jpg

Anyway, after this I tried with another one and I could not duplicate the result. I saw then that if the player is marked with a "man" icon in the player list you can duplicate his customId, while if it has the "PlayFab" icon you cannot duplicate it.

Hope that helps.

Cheers

0 Likes 0 ·
im1.jpg (262.3 KiB)
im2.jpg (377.4 KiB)
brendan avatar image brendan ma-lopez commented ·

I just tried your specific flow, and cannot reproduce the issue. I believe what you are encountering is an issue where the Game Manager shows an ID which is no longer linked to the player account. Try this: First, sign in with CreateAccount set to False to confirm that the player account is correctly linked. Only once you have confirmed that (and doing nothing else between these steps), try calling the Login API method with CreateAccount set to True. If you would like us to test in your specific title (FBA6), please provide the PlayFab ID of a user whose Custom ID you believe can be used to create a new user using that flow. If you do, please paste the text of the ID - do not post it as a picture - so that we can be sure there's no chance of an issue with transcription.

0 Likes 0 ·
ma-lopez avatar image ma-lopez brendan commented ·

As you say I cannot log in with the customID of those players that I can duplicate. It seems they do not exist apart from the dashboard.

Thx for your efforts is a relief to know that I can go on with testing without concerns.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.