fix(client): Fix socket hanging issues and add auto-drain feature
Some checks failed
Default (tags) / security (push) Failing after 26s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped

- Fixed socket hanging issues caused by unconsumed response bodies
- Added automatic response body draining to prevent socket pool exhaustion
- Made auto-drain configurable via autoDrain() method (enabled by default)
- Updated all tests to properly consume response bodies
- Enhanced documentation about response body consumption
This commit is contained in:
2025-07-29 15:49:35 +00:00
parent 1991308d4a
commit 9b9c8fd618
2 changed files with 17 additions and 1 deletions

View File

@@ -1,5 +1,21 @@
# Changelog
## 2025-07-29 - 4.2.1 - fix(client)
Fix socket hanging issues and add auto-drain feature
**Fixes:**
- Fixed socket hanging issues caused by unconsumed response bodies
- Resolved test timeout problems where sockets remained open after tests completed
**Features:**
- Added automatic response body draining to prevent socket pool exhaustion
- Made auto-drain configurable via `autoDrain()` method (enabled by default)
- Added logging when auto-drain activates for debugging purposes
**Improvements:**
- Updated all tests to properly consume response bodies
- Enhanced documentation about the importance of consuming response bodies
## 2025-07-29 - 4.2.0 - feat(client)
Add handle429Backoff method for intelligent rate limit handling

View File

@@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartrequest",
"version": "4.2.0",
"version": "4.2.1",
"private": false,
"description": "A module for modern HTTP/HTTPS requests with support for form data, file uploads, JSON, binary data, streams, and more.",
"exports": {