fix(client): Fix CI configuration, prevent socket hangs with auto-drain, and apply various client/core TypeScript fixes and test updates
This commit is contained in:
41
changelog.md
41
changelog.md
@@ -1,25 +1,41 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-08-18 - 4.2.2 - fix(client)
|
||||
Fix CI configuration, prevent socket hangs with auto-drain, and apply various client/core TypeScript fixes and test updates
|
||||
|
||||
- CI/workflow updates: switch container IMAGE to code.foss.global/host.today/ht-docker-node:npmci, adjust NPMCI_COMPUTED_REPOURL, and install @ship.zone/npmci instead of @shipzone/npmci
|
||||
- Prevent socket hanging by adding automatic draining of unconsumed Node.js response bodies (configurable via options.autoDrain / SmartRequest.autoDrain); added logging when auto-drain runs and updated tests to consume bodies
|
||||
- Client improvements: fixes and cleanups in SmartRequest (accept header mapping, formData header handling, options(), pagination helpers, handle429Backoff backoff/Retry-After parsing and callbacks, retry logic and small API ergonomics)
|
||||
- Core fixes: fetch and node implementations corrected (buildUrl, fetch options, request/response constructors, stream conversions to web ReadableStream, proper error messages) and consistent exports
|
||||
- TypeScript and formatting fixes across many files (consistent trailing commas, object layout, newline fixes, typed function signatures, cleaned up exports and module imports)
|
||||
- Package metadata and tooling updates: package.json bug/homepage URLs adjusted to code.foss.global, bumped @git.zone/tstest devDependency, added pnpm overrides field; small .gitignore additions
|
||||
|
||||
## 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
|
||||
|
||||
**Features:**
|
||||
|
||||
- Added `handle429Backoff()` method to SmartRequest class for automatic HTTP 429 handling
|
||||
- Respects `Retry-After` headers with support for both seconds and HTTP date formats
|
||||
- Configurable exponential backoff when no Retry-After header is present
|
||||
@@ -28,30 +44,37 @@ Add handle429Backoff method for intelligent rate limit handling
|
||||
- Maximum wait time capping to prevent excessive delays
|
||||
|
||||
**Improvements:**
|
||||
|
||||
- Updated test endpoints to use more reliable services (jsonplaceholder, echo.zuplo.io)
|
||||
- Added timeout parameter to test script for better CI/CD compatibility
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Added comprehensive rate limiting section to README with examples
|
||||
- Documented all configuration options for handle429Backoff
|
||||
|
||||
## 2025-07-29 - 4.1.0 - feat(client)
|
||||
|
||||
Add missing options() method to SmartRequest client
|
||||
|
||||
**Features:**
|
||||
|
||||
- Added `options()` method to SmartRequest class for setting arbitrary request options
|
||||
- Enables setting keepAlive and other platform-specific options via fluent API
|
||||
- Added test coverage for keepAlive functionality
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Updated README with examples of using the `options()` method
|
||||
- Added specific examples for enabling keepAlive connections
|
||||
- Corrected all documentation to use `options()` instead of `option()`
|
||||
|
||||
## 2025-07-28 - 4.0.0 - BREAKING CHANGE(core)
|
||||
|
||||
Complete architectural overhaul with cross-platform support
|
||||
|
||||
**Breaking Changes:**
|
||||
|
||||
- Renamed `SmartRequestClient` to `SmartRequest` for simpler, cleaner API
|
||||
- Removed legacy API entirely (no more `/legacy` import path)
|
||||
- Major architectural refactoring:
|
||||
@@ -65,6 +88,7 @@ Complete architectural overhaul with cross-platform support
|
||||
- Removed all "Abstract" prefixes from type names
|
||||
|
||||
**Features:**
|
||||
|
||||
- Full cross-platform support (Node.js and browsers)
|
||||
- Automatic platform detection using @push.rocks/smartenv
|
||||
- Consistent API across platforms with platform-specific capabilities
|
||||
@@ -72,15 +96,18 @@ Complete architectural overhaul with cross-platform support
|
||||
- Better error messages for unsupported platform features
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Completely rewritten README with platform-specific examples
|
||||
- Added architecture overview section
|
||||
- Added migration guide from v2.x and v3.x
|
||||
- Updated all examples to use the new `SmartRequest` class name
|
||||
|
||||
## 2025-07-27 - 3.0.0 - BREAKING CHANGE(core)
|
||||
|
||||
Major architectural refactoring with fetch-like API
|
||||
|
||||
**Breaking Changes:**
|
||||
|
||||
- Legacy API functions are now imported from `@push.rocks/smartrequest/legacy` instead of the main export
|
||||
- Modern API response objects now use fetch-like methods (`.json()`, `.text()`, `.arrayBuffer()`, `.stream()`) instead of direct `.body` access
|
||||
- Renamed `responseType()` method to `accept()` in modern API
|
||||
@@ -94,17 +121,20 @@ Major architectural refactoring with fetch-like API
|
||||
- Legacy API is now just an adapter over the core module
|
||||
|
||||
**Features:**
|
||||
|
||||
- New fetch-like response API with single-use body consumption
|
||||
- Better TypeScript support and type safety
|
||||
- Cleaner separation of concerns between request and response
|
||||
- More predictable behavior aligned with fetch API standards
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Updated all examples to show correct import paths
|
||||
- Added comprehensive examples for the new response API
|
||||
- Enhanced migration guide
|
||||
|
||||
## 2025-04-03 - 2.1.0 - feat(docs)
|
||||
|
||||
Enhance documentation and tests with modern API usage examples and migration guide
|
||||
|
||||
- Updated README to include detailed examples for the modern fluent API, covering GET, POST, headers, query, timeout, retries, and pagination
|
||||
@@ -114,6 +144,7 @@ Enhance documentation and tests with modern API usage examples and migration gui
|
||||
- Minor formatting improvements in the code and documentation examples
|
||||
|
||||
## 2024-11-06 - 2.0.23 - fix(core)
|
||||
|
||||
Enhance type safety for response in binary requests
|
||||
|
||||
- Updated the dependency versions in package.json to their latest versions.
|
||||
@@ -121,31 +152,37 @@ Enhance type safety for response in binary requests
|
||||
- Introduced generic typing to IExtendedIncomingMessage interface for better type safety.
|
||||
|
||||
## 2024-05-29 - 2.0.22 - Documentation
|
||||
|
||||
update description
|
||||
|
||||
## 2024-04-01 - 2.0.21 - Configuration
|
||||
|
||||
Updated configuration files
|
||||
|
||||
- Updated `tsconfig`
|
||||
- Updated `npmextra.json`: githost
|
||||
|
||||
## 2023-07-10 - 2.0.15 - Structure
|
||||
|
||||
Refactored the organization structure
|
||||
|
||||
- Switched to a new organization scheme
|
||||
|
||||
## 2022-07-29 - 1.1.57 to 2.0.0 - Major Update
|
||||
|
||||
Significant changes and improvements leading to a major version update
|
||||
|
||||
- **BREAKING CHANGE**: Switched the core to use ECMAScript modules (ESM)
|
||||
|
||||
## 2018-08-14 - 1.1.12 to 1.1.13 - Functional Enhancements
|
||||
|
||||
Enhanced request capabilities and removed unnecessary dependencies
|
||||
|
||||
- Fixed request module to allow sending strings
|
||||
- Removed CI dependencies
|
||||
|
||||
## 2018-07-19 - 1.1.1 to 1.1.11 - Various Fixes and Improvements
|
||||
|
||||
Improvements and fixes across various components
|
||||
|
||||
- Added formData capability
|
||||
@@ -155,11 +192,13 @@ Improvements and fixes across various components
|
||||
- Updated request ending method
|
||||
|
||||
## 2018-06-19 - 1.0.14 - Structural Fix
|
||||
|
||||
Resolved conflicts with file extensions
|
||||
|
||||
- Changed `.json.ts` to `.jsonrest.ts` to avoid conflicts
|
||||
|
||||
## 2018-06-13 - 1.0.8 to 1.0.10 - Core Updates
|
||||
|
||||
Ensured binary handling compliance
|
||||
|
||||
- Enhanced core to uphold latest standards
|
||||
@@ -167,9 +206,9 @@ Ensured binary handling compliance
|
||||
- Fix for handling and returning binary responses
|
||||
|
||||
## 2017-06-09 - 1.0.4 to 1.0.6 - Infrastructure and Type Improvements
|
||||
|
||||
Types and infrastructure updates
|
||||
|
||||
- Improved types
|
||||
- Removed need for content type on post requests
|
||||
- Updated for new infrastructure
|
||||
|
||||
|
Reference in New Issue
Block a user