question

thornewill avatar image
thornewill asked

PlayFabEconomyAPI.GetItemsAsync sudden 400 - InvalidRequest errors

Hello,

today on May 3rd 2024 around 4:00 AM UTC we started experiencing crashes on our title using PlayFab hosted on AzureFunctions. We found out that the reason for this is sudden change of behaviour of the PlayFabEconomyAPI.GetItemsAsync method which we find weird, as this part of the code has been running without a problem for past 6+ months for us.

The method was returning 400 - Invalid request error because we were passing empty array to the request.Ids in some cases. After we supplied Ids parameter with null, method is working correctly. Said in code:

 // Previous code - non working
     GetItemsRequest itemsRequest = new GetItemsRequest
     {
         AuthenticationContext = GetAuthenticationContext(context),
         AlternateIds = alternateIdsList,
         Ids = uniqueIdsList // <= this list has been initialized list with 0 number of elements
     };
        
     // Updated code - working now
     GetItemsRequest itemsRequest = new GetItemsRequest
     {
         AuthenticationContext = GetAuthenticationContext(context),
         AlternateIds = alternateIdsList.Count <= 0 ? null : alternateIdsList,
         Ids = uniqueIdsList.Count <= 0 ? null : uniqueIdsList
     };

Based on this, I assume something was changed on your side regarding requests handling. Can you please:

1) Confirm that some change on your end really occured

2) If so, can it affect also other methods behaviour?

3) Do you have any webpage where we can monitor similar changes like this?**

Thanks in advance for your answer!

CloudScriptPlayer Inventory
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

·
kylemc@microsoft.com avatar image
kylemc@microsoft.com answered

Thank you for reporting this issue. I suspect we rolled out FriendlyId support to that API and changed the behavior slightly. I'm glad you were able to mitigate it so quickly.

  1. Yes, changes occurred, but they weren't an intentional regression

  2. GetItem and SearchItems may also exhibit a similar behavior

  3. We try not to roll out breaking changes. As such, there isn't a feed for notifications. In the rare case where we deprecate a feature, I believe we post about it on the blog first.

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.