Hello,
I unfortunately can’t share a working debug file since I encountered the problem on some private API.
I’ll try to give as much details as possible so that you can reproduce in your test setup:
- Trigger on the same frame 2 or more asynchronous .request() calls.
- You might observe that the callback “onResponse” would trigger only once, and the other calls are getting “lost”.
I tested with Postman against the same API to trigger plenty of calls in a row, and always got the expected responses.
I tested in Touch to add a delay of multiple frames using run(), and was able to get the response.
The API in question is throttled at 5 calls per seconds, triggering 2 requests on the same frame should not be a problem.
I noticed, in the responses header, that the first response has a specified size in kb, while the other one doesn’t. Could this cause an issue ?
When triggering both requests from the Textport, one after the other (not on the same frame) I get both responses as expected. Triggering from, let’s say, a DAT execute or CHOP execute, both on the same frame, cause the issue.
I was wondering, with the little knowledge I have on the backend, if it could be a threading issue ? Could the asynchronous call send back responses at almost the same time, and while the WebClient DAT is busy parsing a response, it is locked and the second response is silently failing / getting lost.
I know it’s very little to help debug, but maybe you are already aware of something, or it can give you an idea where to look at…
Let me know if I can help more,
Thanks,
Michel