question

Andrzej Korolczuk avatar image
Andrzej Korolczuk asked

Conflict error when calling UpdateUserTitleDisplayName

Hi

Title ID: 1218

We're experiencing errors while calling UpdateUserTitleDisplayName upon registering of new user. In our registration flow we try to login with custom id via LoginWithCustomID and if there's no user we call the same method again with CreateAccount parameter set to true. Then we generate random name and call UpdateUserTitleDisplayName. We only call UpdateUserTitleDisplayName after getting response from LoginWithCustomID.

This usually works fine but every now and then we get an error from playfab indicating that something else is writing to the same field.

Error data:

code Integer
status String Conflict
error String A conflict occurred trying to make multiple edits to the same data at the same time. This often indicates that there are multiple concurrent requests to the same API for the same player
errorCode Integer
errorMessage String A conflict occurred trying to make multiple edits to the same data at the same time. This often indicates that there are multiple concurrent requests to the same API for the same player
errorHash String 4f1aed10852571ae81c05b6238d6ba28
errorDetails Object
RequestID Array
[0] String 1-5e273196-f1411c802702de00ce456e00

Any ideas what we could be doing wrong?

apisCloudScript
3 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.

Sarah Zhang avatar image Sarah Zhang commented ·

You can try to review this thread for more info on this particular error: https://community.playfab.com/questions/17862/409-conflict-when-calling-getcontentuploadurl.html. In short, there are a number of things that could cause this, occasionally, but if you're using good coding practices to ensure you don't have multiple calls to the service at the same time, it should be fairly rare. Could you provide the client main code corresponding to this issue so we can try to analyze it? Please notice hiding your personal information.

0 Likes 0 ·
Andrzej Korolczuk avatar image Andrzej Korolczuk commented ·

Hi Sarah. That's for response. I don't think I can extract that code easily as it's a part of more complex bootstrapping process.

I guess we have some cloudscripts triggered from Rules on com.playfab.player_added.title event. But also the client makes multiple api calls.

Could you tell me what is considered a writing conflict? For example if I change player's display name using UpdateUserTitleDisplayName and an entry in his title data would this cause a write error? Would writing to 2 different title data fields at the same time cause a conflict too?

0 Likes 0 ·
Andrzej Korolczuk avatar image Andrzej Korolczuk commented ·

I tested some more and we also get this conflict error for writing using UpdateUserData but the key we're using is only used in that 1 instance and we only make 1 request. My understanding was that conflicts are only caused by writing to exactly the same field, but errors we're getting are all over the place.. Different fields, but also when calling UpdateUserTitleDisplayName.

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

The first example that you cites has possibility to cause the conflict error. You can check this reply to check the possible reasons that may cause conflict error.

>> Would writing to 2 different title data fields at the same time cause a conflict too?

If you mean multiple concurrent requests to the same API’s different fields for the same player. This situation will cause the conflict. This error is targeted to the API, not data fields. So, Can you review the update data logic flow, to make sure there aren't two simultaneous requests being sent?

In addition, what’s the customId do you use in LoginWithCustomID, is it a device Id? Actually, you can always make the CreateAccount field as true, then determine if this is a new user based on the field NewlyCreated in the response. The workflow of login may not be the reason, just some possibilities.

10 |1200

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

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.