mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-18 22:53:23 +00:00
Implement connection persistence for offerer side through "offer rotation". When a connection fails, the same OffererConnection object is rebound to a new offer instead of being destroyed, preserving message buffers and event listeners. Features: - Connection objects persist across disconnections - Message buffering works seamlessly through rotations - Event listeners remain active after rotation - New `connection:rotated` event for tracking offer changes - Max rotation attempts limit (default: 5) with fallback Implementation: - Add OffererConnection.rebindToOffer() method with AsyncLock protection - Add rotation tracking: rotating flag, rotationAttempts counter - Add OfferPool.createNewOfferForRotation() helper method - Modify OfferPool failure handler to rotate instead of destroy - Add connection:rotated event to OfferPoolEvents interface - Forward connection:rotated event in Rondevu class - Add edge case handling for cleanup during rotation - Reset rotation attempts on successful connection Documentation: - Add "Connection Persistence" section to README with examples - Update "New in v0.20.0" feature list - Add v0.20.0 changelog entry - Document rotation benefits and behavior Benefits: - Same connection object remains usable through disconnections - Message buffer preserved during temporary disconnections - Event listeners don't need to be re-registered - Simpler user code - no need to track new connections 100% backward compatible - no breaking changes. 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1.2 KiB
1.2 KiB