Performance issues with connection::request() with HTTP 500 status, delays up to 16 seconds
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 551
- Avg merge
- 9h 2m
- Merged PRs (30d)
- 3
Description
Hi,
I recently faced an issue while doing requests of the following way:
const requestOptions: HttpRequest = {
method: 'GET',
url: `/services/apexrest/website/some-apex-endpoint/${data-id}`,
headers: {
'content-type': 'application/json',
}
};
// ...... some code
const response = await conn.request(requestOptions);
If some-apex-endpoint returns a HTTP 500, the request() call can take up to 16 seconds to return. Adding the option { responseType: 'text' }has had no effect on reducing the execution time.
Replacing the code with a regular Javascript fetch() has reduced the execution back to a more sensible 200 ms average execution time.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the delay through the conn.request() entry point with an HTTP 500 response, then compare it with the reported fetch() behavior. Inspect the request implementation and determine what causes the excess wait; done means HTTP 500 responses return without the reported delay. No file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100