Skip to content

fix(routerlicious-driver): retry transient network errors in restWrapper#27631

Open
arafat-java wants to merge 1 commit into
microsoft:mainfrom
arafat-java:fix/routerlicious-driver-retry-transient-network-errors
Open

fix(routerlicious-driver): retry transient network errors in restWrapper#27631
arafat-java wants to merge 1 commit into
microsoft:mainfrom
arafat-java:fix/routerlicious-driver-retry-transient-network-errors

Conversation

@arafat-java

Copy link
Copy Markdown
Contributor

How contribute to this repo.

Guidelines for Pull Requests.

Description

Port of a fix validated in a downstream fork (concurrent-editing, commit f71f3c4), adapted to this repo's current restWrapper.ts/restWrapper.spec.ts conventions (which have diverged from the vendored copy — different imports, sinon-based test mocking instead of nock).

The routerlicious driver can run in environments (e.g. AWS Lambda) where the execution context is frozen between invocations. A keep-alive socket pooled by the underlying fetch transport can be closed by the peer (e.g. an ALB) during the freeze; the next request reuses the dead socket and rejects with "socket hang up" / ECONNRESET / EPIPE. request() now retries such transient network errors on a fresh socket, up to 3 attempts (1 initial + 2 retries, 250ms apart), before surfacing the error. A self-signed-certificate failure is excluded from retry since it's permanent, not transient.

Reviewer Guidance

The review process is outlined on this wiki page.

The retry bound (3 attempts) and delay (250ms) were chosen empirically in the downstream fork; happy to discuss if a different value/backoff strategy is preferred. This was authored in an environment without network access to build/test locally — CI will be the first real verification.

Ported from a fix validated in a downstream fork (concurrent-editing microsoft#232),
adapted to this repo's current restWrapper.ts/restWrapper.spec.ts conventions.
Copilot AI review requested due to automatic review settings July 1, 2026 02:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (212 lines, 2 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants