LibreChat/packages/api/src/stream/implementations
Danny Avila 252a5cc7ca
🔗 fix: Preserve Stream State Across Reconnects to Prevent Reorder Buffer Desync (#11842)
When all subscribers left a stream, both RedisEventTransport and
  InMemoryEventTransport deleted the entire stream state, destroying
  the allSubscribersLeftCallbacks and abortCallbacks registered by
  GenerationJobManager.createJob(). On the next subscribe/unsubscribe
  cycle, the callback that resets hasSubscriber was gone, causing
  syncReorderBuffer to be skipped on subsequent reconnects. This led
  to the reorder buffer expecting seq 0 while the publisher was at
  seq 300+, triggering a 500ms force-flush timeout and "skipping N
  missing messages" warnings.

  Fix: preserve stream state (callbacks, abort handlers) when the last
  subscriber leaves instead of deleting it. State is fully cleaned up
  by cleanup() when the job completes, aborts, or is collected by
  periodic orphan cleanup.
2026-02-18 01:57:34 -05:00
..
index.ts 🌊 feat: Resumable LLM Streams with Horizontal Scaling (#10926) 2025-12-19 12:14:19 -05:00
InMemoryEventTransport.ts 🔗 fix: Preserve Stream State Across Reconnects to Prevent Reorder Buffer Desync (#11842) 2026-02-18 01:57:34 -05:00
InMemoryJobStore.ts 💰 fix: Multi-Agent Token Spending & Prevent Double-Spend (#11433) 2026-01-20 14:43:19 -05:00
RedisEventTransport.ts 🔗 fix: Preserve Stream State Across Reconnects to Prevent Reorder Buffer Desync (#11842) 2026-02-18 01:57:34 -05:00
RedisJobStore.ts ⚛️ refactor: Redis Scalability Improvements for High-Throughput Deployments (#11840) 2026-02-18 00:04:33 -05:00