v0.19.0: Internal refactoring for improved maintainability

Internal improvements (100% backward compatible):

- Extract OfferPool class from Rondevu for offer lifecycle management
- Consolidate ICE polling logic into base RondevuConnection class
  (removes ~86 lines of duplicate code)
- Add AsyncLock utility for race-free concurrent operations
- Disable reconnection for offerer connections (offers are ephemeral)
- Fix compilation with abstract method implementations

Architecture improvements:
- rondevu.ts: Reduced complexity by extracting OfferPool
- connection.ts: Added consolidated pollIceCandidates() implementation
- offerer-connection.ts: Force reconnectEnabled: false in constructor
- answerer-connection.ts: Implement abstract methods from base class

New files:
- src/async-lock.ts: Mutual exclusion primitive for async operations
- src/offer-pool.ts: Manages WebRTC offer lifecycle independently

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-16 22:03:32 +01:00
parent 7c903f7e23
commit c30e554525
8 changed files with 501 additions and 257 deletions

View File

@@ -15,12 +15,13 @@ TypeScript/JavaScript client for Rondevu, providing WebRTC signaling with **auto
## Features
### ✨ New in v0.18.11
### ✨ New in v0.19.0
- **🔄 Automatic Reconnection**: Built-in exponential backoff for failed connections
- **📦 Message Buffering**: Queues messages during disconnections, replays on reconnect
- **📊 Connection State Machine**: Explicit lifecycle tracking with native RTC events
- **🎯 Rich Event System**: 20+ events for monitoring connection health
- **⚡ Improved Reliability**: ICE polling lifecycle management, proper cleanup
- **🏗️ Internal Refactoring**: Cleaner codebase with OfferPool extraction and consolidated ICE polling
### Core Features
- **Username Claiming**: Secure ownership with Ed25519 signatures
@@ -366,7 +367,15 @@ const connection = await rondevu.connectToService({
## Changelog
### v0.18.11 (Latest)
### v0.19.0 (Latest)
- **Internal Refactoring** - Improved codebase maintainability (no API changes)
- Extract OfferPool class for offer lifecycle management
- Consolidate ICE polling logic (remove ~86 lines of duplicate code)
- Add AsyncLock utility for race-free concurrent operations
- Disable reconnection for offerer connections (offers are ephemeral)
- 100% backward compatible - upgrade without code changes
### v0.18.11
- Restore EventEmitter-based durable connections (same as v0.18.9)
- Durable WebRTC connections with state machine
- Automatic reconnection with exponential backoff