The client.post method retries the request multiple times, if the server answers with an error code like 5xx, even if i set the options to maxAttempts=1.
On my local environment everything works as expected but in production (the published custom app) it doesn’t work.
Hey, thanks for your replies!
I use fdk version 8.3.1.
Here you can find the fdk.log: fdk.log (19.9 KB)
It’s hard to reproduce this issue, because it’s only happening in the production custom app and only if the server needs too much time to answer. I’ll try my best to reproduce this again and share the HAR file with you.
Hmm… if this is happening only in production and not in local. Then fdk.log file is not helpful. (However, I checked the log file, but doesn’t have records of requests being sent proxy.js calls in it.)
Although it’s hard to reproduce the issue deliberately, do you frequently see this happening? If yes, I will try use a sample code to make requests and a dummy api that responds with 5XX.
Hey,
finally i could reproduce this issue. I created a new button in our production app which sends a request to our backend and created a test route in our backend which sends the status code 504.
The client always do 2 attempts, even if i set the maxAttempts to 1 (see HAR file).
Thank you! Approximately how long will it take before we have a result?
It’s really urgent because we use our custom FreshdeskApp to create refunds and replacement orders and because of this issue, sometimes (if the server takes too long) the freshdesk client starts a second attempt and so two refunds/replacement orders are created which is really bad
I appreciate your patience with this issue. I understand this is blocking your use case. I do not have an estimated timeline yet. We are trying to investigate if this is a bug in production.
I have learnt so far that there were some internal changes because of which the maxAttempts have been increased to a minimum of 2. This is not yet documented, so we are trying to figure out how to get it back to 1.
Appreciate for your patience while we were investigating and getting to the bottom of this issue.
I’m happy to share with you that this issue has been fixed. The maxAttempts default value is 1 but due to some internal changes it had been increased to 2 and now reverted back. Now your API requests should not retry multiple times if there is a 5xx error code.
Also, thanks again for bringing this into our notice. Happy to help if you are facing any other concerns.