question

hfawns avatar image
hfawns asked

Is it possible to get multiple callbacks from a UE4 client api call?

When making a client api call using the UE4 plugin we are suspicious that we have received more than one callback. This could be more than one success callback, more than one failure callback or a combination of success and failure callbacks. Our code is designed expecting only one callback from each client api call - either a success or failure. Is it possible to receive more than one callback?

apisunreal
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

·
Seth Du avatar image
Seth Du answered

You can only receive one callback per request. If you are suspicious about any API, you can quickly test it via some RESTful API testing tool, for example, POSTMAN.

There is also a possibility that multiple threads are created for several requests in a short time, you may use network capture tools to check if the extra callbacks are from other threads.

In addition, you can check the logic of code/blueprint in your UE4 project. In my point of view, it is most likely an issue when you deploy APIs, and if there is only some specific APIs that are returning multiple callbacks, you just need to locate those API implementations.

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.

hfawns avatar image hfawns commented ·

Looking at the statistics for our server on the Overview page (above) we noticed that there was a large, abnormal spike in cloud script processing time for a particular cloudscript function at the time that our problem occurred (5PM UTC yesterday):

The processing time is consistently under 1K ms at all times but during this period it was over 3K ms. What we think happened is that during that period we were making a number of calls to this particular function which were failing due to abnormal conditions on the playfab servers. We and we were receiving failure callbacks. We believe that we later received success callbacks for these calls. The problem would also arise if we received more than one failure or success callback. Our code isn't designed to handle than one response. This is the first time we have experienced the issue and the time the problem occurred corresponds very closely to the spikes in processing time on the Playfab server. Is there any way that cloudscripts functions could return multiple success or failure callbacks when those functions behave in an unusual way?

0 Likes 0 ·
capture.jpg (26.3 KiB)
brendan avatar image brendan ♦♦ hfawns commented ·

No. A Cloud Script call can only return one response. There is no call in the PlayFab service that could return multiple responses. What I would recommend is that you either a) put a breakpoint in your code for where Web API calls are actually sent and another where responses are processed, or b) get a Wireshark capture, so that you can examine the details of the actual traffic. As Seth pointed out, if you are seeing more than one response to a particular call, that would mean your client is making more than one request.

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.