Skip to content

DX | 03-08-2026 | Release - #242

Merged
reeshika-h merged 17 commits into
mainfrom
development
Aug 3, 2026
Merged

DX | 03-08-2026 | Release#242
reeshika-h merged 17 commits into
mainfrom
development

Conversation

@reeshika-h

@reeshika-h reeshika-h commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Enhancements

  • Improved connection reliability: request timeouts are now classified distinctly from unknown errors, transient network errors (ECONNABORTED, ETIMEDOUT, ECONNRESET, EPIPE, EAI_AGAIN) are automatically retried, and keep-alive connections are enabled by default in Node environments.

harshitha-cstk and others added 17 commits May 25, 2026 13:54
chore: back-merge main into development
chore: back-merge main into development
retryResponseErrorHandler threw a plain object literal (error_message/error_code
fields, no .message) for axios ECONNABORTED (client-side timeout) errors.
APIError.fromAxiosError only recognizes .response.data, .request, or .message,
so the plain object matched none of those and collapsed to a generic
UNKNOWN_ERROR/status:0 - indistinguishable from a true network-layer failure,
with no indication the request had actually timed out.

Throw a real Error with .message and .code set instead, so it flows through
the existing err.message branch in fromAxiosError and surfaces as a distinct,
diagnosable TIMEOUT (408) error.

DX-9991
No longer needed now that the ECONNABORTED branch throws a real Error
instead of a plain object literal.

DX-9991
The default retryCondition only ever matched HTTP 429, so any network-level
failure (DNS resolution failure, connection reset, client-side timeout) with
no HTTP response got zero retries out of the box, even though the retry
mechanism to handle them already existed and was already tested (retrying
via a custom retryCondition already worked).

Add a default retryCondition fallback covering ECONNABORTED, ETIMEDOUT,
ECONNRESET, EPIPE, and EAI_AGAIN (DNS transient failure) when there is no
response - deliberately excluding ENOTFOUND and ECONNREFUSED, which usually
indicate a persistent misconfiguration rather than a transient blip.

Placed in delivery-sdk-handlers.ts's own defaultConfig rather than
contentstack-core.ts's httpClient defaults, since retryResponseErrorHandler
is invoked with the raw StackConfig (see contentstack-typescript's
stack/contentstack.ts), not client.defaults - a retryCondition set only on
the axios instance defaults never reaches the actual retry decision.
Verified against the real call pattern, not just isolated unit tests.

DX-9991
httpAgent/httpsAgent defaulted to false, so every request opened a fresh
TCP/TLS connection with zero reuse - relevant under Next.js prerendering
concurrency, where redundant connection setup adds latency that pushes
more requests toward the request timeout.

Default to a keepAlive http.Agent/https.Agent instead, guarded behind a
Node-only runtime check (typeof window === 'undefined', matching the
existing isBrowser() convention in contentstack-typescript) since
@contentstack/core has no browser field to redirect Node-only imports
away from browser bundles the way axios does for itself.

A fresh agent is created per httpClient() call rather than a shared
module-level singleton - a deliberate tradeoff to avoid shared state
across separate stack() instances in the same process.

No behavior change for callers who already set their own httpAgent/
httpsAgent (including explicit false), and no behavior change at all in
browser environments.

DX-9991
Removes duplication between the httpAgent and httpsAgent defaults.

DX-9991
…andling

fix: classify request timeouts distinctly instead of unknown error
Merging development (with the timeout classification fix) surfaced an
interaction: the classification test didn't set retryCondition, so it now
picks up the new default retryCondition (which retries ECONNABORTED),
taking the retry path instead of the classification path it was meant to
test. Same fix as already applied to the other pre-existing ECONNABORTED
test - explicitly disable retryCondition to isolate the behavior under test.

DX-9991
…rrors

fix: retry transient network errors by default
…ction-pooling

Default to keep-alive agents in Node environments for better performance
Bundles the three DX-9991 fixes: timeout classification, default retry
for transient network errors, and default keep-alive connection agents.

DX-9991
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 0 ✅ Passed
🔵 Low Severity 0 0 0 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@snyk-io

snyk-io Bot commented Aug 3, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cs-raj
cs-raj marked this pull request as ready for review August 3, 2026 08:24
@cs-raj
cs-raj requested a review from a team as a code owner August 3, 2026 08:24
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@reeshika-h
reeshika-h merged commit 124b694 into main Aug 3, 2026
13 of 16 checks passed
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.

5 participants