Skip to content

fix: Wire timeout option through to flag polling and event delivery requests#1760

Open
joker23 wants to merge 1 commit into
mainfrom
skz/sdk-2576/wire-timeout-option
Open

fix: Wire timeout option through to flag polling and event delivery requests#1760
joker23 wants to merge 1 commit into
mainfrom
skz/sdk-2576/wire-timeout-option

Conversation

@joker23

@joker23 joker23 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The timeout configuration was stored in configuration but never threaded
through the datamanger so all connections ran without any timeout
regardless of configuration. This commit will fix this for the node
server sdk (we still need to assess this for client side sdks and see if
it is a problem for other server side sdks).

In addition, this commit will also set the timeout default to 10s which
is consistent with most other server side sdks (eg python, ruby, c++,
etc).


Note

Medium Risk
Changes the default network timeout and alters failure behavior for slow or stuck upstreams during flag polling; apps that relied on 5s or sub-1 values will see different timing without code changes.

Overview
Fixes timeout so it actually limits how long flag polling HTTP calls can hang, instead of being stored in config but never passed to the platform layer.

Requestor now converts configured seconds to milliseconds and sets options.timeout on polling fetch calls. NodeRequests adds a timeout listener that **destroy**s the request with Request timed out when the socket timeout fires (with a regression test against a non-responding server).

Configuration changes: default timeout rises from 5s to 10s (aligned with other server SDKs), validation requires ≥ 1 (invalid 0 clamps to 1 with a warning), and diagnostics/tests reflect the new defaults.

Reviewed by Cursor Bugbot for commit 037606a. Bugbot is set up for automated code reviews on this repo. Configure here.

…equests

The timeout configuration was stored in configuration but never threaded
through the datamanger so all connections ran without any timeout
regardless of configuration. This commit will fix this for the node
server sdk (we still need to assess this for client side sdks and see if
it is a problem for other server side sdks).

In addition, this commit will also set the timeout default to 10s which
is consistent with most other server side sdks (eg python, ruby, c++,
etc).
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26365 bytes
Compressed size limit: 29000
Uncompressed size: 129044 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31978 bytes
Compressed size limit: 34000
Uncompressed size: 114243 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38739 bytes
Compressed size limit: 39000
Uncompressed size: 212244 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179579 bytes
Compressed size limit: 200000
Uncompressed size: 831422 bytes

streamUri: TypeValidators.String,
eventsUri: TypeValidators.String,
timeout: TypeValidators.Number,
timeout: TypeValidators.numberWithMin(1),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is no specs on this AFAIK, open to discuss... currently the thought is that timeout should exist and must be a valid timeout. Alternatives that I think could work are:

  1. accept 0 and make to "no timeout"
  2. define a stricter min (eg 5 seconds) to prevent friendly fire

@joker23

joker23 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 037606a. Configure here.

@joker23 joker23 marked this pull request as ready for review June 22, 2026 17:31
@joker23 joker23 requested a review from a team as a code owner June 22, 2026 17:31

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin 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.

1 participant