question

Christopher Clogg avatar image
Christopher Clogg asked

UpdateUserData after login with createAccount=true

For about 10 days now we've been having issues with the UpdateUserData call in our game client. We use this API right after LoginWithCustomID (createAccount=true). I noticed someone else posting about issues with updating user data, so maybe it's something related... but anyway it started happening during a time when we did not change our code or game client at all, and the code in question that does this had been working since 2018.

From what I can see, it works for some users, but not for others. But even for the ones that it doesn't work, the next time they login it works. However we still need to find out why it isn't working just after account creation... Did something change with regards to this?

Thanks.

apis
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.

Seth Du avatar image Seth Du ♦ commented ·

May I ask is there any error messages reported? Does the UpdateUserData return a successful callback but the value doesn't change?

In addition, Please provide your title ID and related Player ID if possible.

0 Likes 0 ·
Christopher Clogg avatar image Christopher Clogg Seth Du ♦ commented ·

Unfortunately I don't have the exact error as we weren't logging the error for that on the client yet.
Title ID is D36D and an example player ID is 90A7742C2265950B. That account should have a field sName in userdata but it does not. On the contrary, another fresh account 442B9C07817B03FB has the user data. Both players are using the same game client/code, so both should have that sName field added... at least historically this was true for us up until a few weeks ago.

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

@Chris Hi Chris,

In general, you’re going to run into this issue of “409 conflict” when you’re making multiple calls without waiting on the responses. We have plenty of servers managing all the API calls, sometime that’ll work fine, as different servers are handling the calls. However, sometimes you’ll wind up with both calls hitting the same server. And, if the API calls are acting on the same data even if they’re using the different servers, you’ll probably also run into this issue. Also, sometimes unusual load condition would prevent API calls from being successful too(However, I don’t think it related to your issue, it’s just for clarity). For more info, please refer to this thread Brendan answered.

The best practices for making API calls that act on the same data is to wait for the successful callback and then make any additional calls. It’s highly possible that is the cause of your issue. If that’s the case, what you can do is make your UpdateUserData call in the success callback of your first call(LoginWithCustomId) to see if it works. Otherwise, if you’re making API calls following the recommended way, could you please provide us the code so we can reproduce your issue and investigate it? Thanks.

5 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.

Christopher Clogg avatar image Christopher Clogg commented ·

Hi, yes I am doing the UpdateUserData call in the success callback. I am also making several other API calls then too. They all work in every case (as far as I know) except sometimes for new users only, and even for them this issue has only been happening since mid-August.

Here is my C# code with just the relevant stuff. I also put in temp values so you'll need to change them if using this code:

https://pastebin.com/rVxj81tj

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Christopher Clogg commented ·

Alright, I will test it and keep you informed:)

0 Likes 0 ·
Christopher Clogg avatar image Christopher Clogg Citrus Yan commented ·

I have not identified anything new. It is still happening and I still don't know why :/

0 Likes 0 ·
Show more comments
Seth Du avatar image
Seth Du answered

I'd suggest you to add logging functions in your clients if possible. This is not easy to track an occasional case because we don't even know if the call is sent successfully to PlayFab server. There are many possibilities if the cases is only 'not updated' and error messages will tell that this is not something like network issue.

Hence, here is the thing you may do:

  • Add log functions in the clients
  • Try to reproduce it via massive tests, and if it keeps occurring, you may tell us with detailed reproduction procedure.

Besides, I will still discuss this with the team.

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

Christopher Clogg avatar image Christopher Clogg commented ·

Okay I'll see if I can get it captured from my end too.

0 Likes 0 ·
Christopher Clogg avatar image Christopher Clogg commented ·

Okay I added an analytics event to capture it from the clients when it happens. Looks like the couple that have come in right now say the UpdateUserData error was: "409 Conflict"

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Christopher Clogg commented ·

Is there any possibility that the player is updating data using different endpoint clients at the same time? A 409 Conflict error indicates that there were concurrent attempts to update the same data at the same time, and that the second update was rejected.

0 Likes 0 ·
Christopher Clogg avatar image Christopher Clogg Seth Du ♦ commented ·

I don't think it would be possible since it's the first time creation of an account when this seems to fail, and our game is on Steam only. Also it couldn't be 2 updates at the same time because that would imply one worked, but on these new players, there is no key/value present (until their 2nd login where it just seems to work).

0 Likes 0 ·
Show more comments
Show more comments
Christopher Clogg avatar image
Christopher Clogg answered

I am posting this here for visibility, from Citrus Yan: Hi Chris, just got the feedback from the team, The 409 indicates that the player creation hadn't fully committed to the database when you made the UpdateUserData call. We suggest that you handle the error and retry with exponential back-off in case you hit the error again for some reason.
-> So what I will likely do is delay the UpdateUserData call (on new creation) for a few seconds.

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.