Last 12 weeks · 4 commits
2 of 6 standards met
Description The current implementation has a hardcoded 1000ms timeout that makes the system fragile in unstable network conditions. Problem Code Issues 1. Hardcoded timeout is inflexible: The 1000ms timeout cannot adapt to different network environments 2. Too aggressive: 1 second may be insufficient for high-latency or unstable networks 3. Confusing logic: The delay and the timeout check both use 1000ms, meaning the timeout error will almost always trigger when the timer fires Impact Systems fail unnecessarily in slower network conditions No way for users to configure timeout based on their environment Production deployments in high-latency regions become unreliable Suggested Solutions Option 1: Configurable Timeout Option 2: Retry with Backoff Implement exponential backoff retry logic instead of a single hard timeout. Environment Network latency: Variable (100ms - 2000ms in our production) This affects production stability Would you be open to a PR implementing configurable timeouts? ```
Summary Adds a new generic entry point that allows users to provide their own Publisher/Subscriber implementations, making the library compatible with any Redis-like client (Upstash Redis, Valkey, etc.). Changes New entry point: - requires custom Publisher/Subscriber implementations Comprehensive tests: 4 new tests covering basic usage, resumption, and error handling Updated documentation: README now includes section on using custom Redis clients with example code Package configuration: Added exports and TypeScript definitions for the generic module Usage Example
Repository: vercel/resumable-stream. Description: Stream resumption for web streams Stars: 522, Forks: 35. Primary language: TypeScript. Languages: TypeScript (95.6%), Shell (4.4%). License: MIT. Homepage: https://sdk.vercel.ai Open PRs: 8, open issues: 9. Last activity: 2mo ago. Community health: 50%. Top contributors: cramforce, ethshea, mattpocock, MaxLeiter, ghislainf, lgrammel, MrLoh, matanper.
Add option to to allow overriding the default 24-hour (86400s) TTL for Redis keys. Pass the TTL value through the context and use it in all relevant Redis operations. Update documentation and README with usage examples for the new option. No breaking changes; default behavior remains unchanged if is not provided.
Description Problem The ioredis adapter in adds a event listener on each call but never removes it when is called. This causes event listeners to accumulate over time, leading to: Root Cause In : Each stream creates a listener via , but when the stream ends and is called in , only the Redis channel subscription is removed - the event listener stays attached to the client forever. Impact After ~50 streams (or whatever is set to), Node.js emits a warning Event listeners continue to accumulate indefinitely Memory usage grows over time Each orphaned listener still executes on every Redis message, degrading performance Solution Store a reference to each listener function and properly remove it when unsubscribing: How to Reproduce 1. Create a resumable stream context with ioredis 2. Create and complete 50+ streams 3. Observe the in console