question

Alberto Gomez avatar image
Alberto Gomez asked

KeyToRemove used in UpdateUserData returns Error 500: Internal server error

Hi! I'm trying to remove some keys from an specific user via UpdateUserData, and everytime I do it, the internal server error pops up.

Could this be a bug from the SDK?

Here is some sample code (I'm using the last updated Unity SDK):

UpdateUserDataRequest request = new UpdateUserDataRequest();
request.Data = new Dictionary<string, string>();
request.KeysToRemove = new List<string>();

for (int o = 0; o < 30; o++)
{
    if (PlayerPrefs.HasKey(GlobalConstants.TUTORIAL_STATUS_ + o))
       request.Data.Add(GlobalConstants.TUTORIAL_STATUS_ + o, PlayerPrefs.GetString(GlobalConstants.TUTORIAL_STATUS_ + o));
    else
       request.KeysToRemove.Add(GlobalConstants.TUTORIAL_STATUS_ + o);
}

PlayFabClientAPI.UpdateUserData(request, OnUserUpdateData, OnUpdateCloudPrefsError);

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Looking at the service log, the issue is that you're passing in null for some of the KeysToRemove. Specifically, in the log entry I looked at, the first three were null:

"KeysToRemove":[null,null,null,"ART_ID_0", ...

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.