Version: 1.41.1 (system setup)
Date: 2019-12-18T14:58:56.166Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0 V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18363
Steps to Reproduce:
Start Debugging in VS 2019 for the Azure Function App and put the debug point in the entry function.
Click on the SendRequest link visible in the file.
For one time click, same api is called three times. Debug point hits 3 times. The response in VS code is shown after all 3 calls are complete. This causes very slow feedback loop.
@nitinmahajan10 it seems doesn't possible for me. Did you Azure function app will return 3XX or 401 response? You can set the rest-client.followredirect to false to verify if redirection happens
@Huachao thanks for quick response. I checked the behavior is when response is "500 Internal Server Error" or returning this:
return new ExceptionResult(ex, true);
This happens even after setting :
"rest-client.followredirect": false
@nitinmahajan10 do you mean no matter enable redirection or not, click Send Request once will always hit your Azure Function App three times? And if so, what's the response of each call at the server side?
I'm getting the same behavior. If my rest service returns a 500 it will attempt 3 times before returning the response. If the response is a 200 it only makes a single call.
It seems as if there is some error handling to automatically retry the request up to 3 times. If this is the case then a setting to disable or set the number of retries would be nice.
Looks like this is coming from https://github.com/Huachao/vscode-restclient/blob/d47bc090d69fdc3b751b0faa7c2eedfd81f47a3f/src/views/httpResponseTextDocumentView.ts#L60
It's hardcoded to retry twice on EOL
@brentahughes @nitinmahajan10 the root cause is that the underlying httpclient package got will automatically retry on specific response status codes. I have fixed this issue and will be published in the next release.
@brentahughes @nitinmahajan10 you can verify this in the latest version 0.23.1
@Huachao This update has broken my usage of the REST Client. I'm not exactly sure which change broke, but I suspect this one. There are a lot of redirects that happen on login attempt and now I can't successfully login after this update.
If there is some logging I can enable on the Rest Client or something, maybe I could be more specific.
@dakaraphi you mean a lot of redirects happened in the login API? Are there any redirected URLs contains port number in it?
I honestly don't know exactly what is happening. I'm just aware that redirects are sometimes used. It is not an area of code I work on, so I'm going to have to figure out a way to debug the problem. It will not be easy from the server side as it is very complex, so I was hoping there was some way of logging in more detail what is happening with the client.
@dakaraphi can you try if this version of extension works, you need to install it in the Extensions sidebar, and Click the ... and the Install from VSIX option. Note, you need to first remove the trailing .txt text in the file name.
It does not work. So must be some other change. I will create a new issue.