Retry handler should retry on connect timeout

Open
#330 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
api

Research direction

Start in src/middleware/RetryHandler.ts at lines 176-189, referenced by the issue, and inspect the retry middleware's existing error handling. Use the reported FetchError with connect ETIMEDOUT as the case to cover, then verify that the middleware retries it and that existing retry behavior remains intact.

Written by the indexing model from the issue text.

Description

enhancement

Feature Request

Is your feature request related to a problem? Please describe

Currently the retry handler only rethrows when the underlining request throws:
https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/130f3c0e9d329498ef8444d86181255b640d5743/src/middleware/RetryHandler.ts#L176-L189

This means that a connect timeout will not be retried. This happened in production for us the other day.

{ statusCode: -1, code: "FetchError", message: "request to https://graph.microsoft.com/v1.0/me/mailboxSettings failed, reason: connect ETIMEDOUT 40.126.6.114:443", requestId: null, date: {}, body: "FetchError: request to https://graph.microsoft.com/v1.0/me/mailboxSettings failed, reason: connect ETIMEDOUT 40.126.6.114:443" } 

Describe the solution you'd like

The retry middleware should catch the connection timeout and retry.

AB#6270

Dominant language
TypeScript
Stars
833
Forks
240
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoftgraph/msgraph-sdk-javascript

All issues in microsoftgraph/msgraph-sdk-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.