-
Notifications
You must be signed in to change notification settings - Fork 18
Device Preference Management #1295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jpsantosbh
wants to merge
40
commits into
main
Choose a base branch
from
joao/sd-reliability-devices
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+9,833
−15
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…le to send the `verto.answer` (#1263)
Fabric references renamed too Call
# Conflicts: # internal/e2e-client/playwright.config.ts # package-lock.json # packages/js/CHANGELOG.md # packages/js/package.json # packages/realtime-api/CHANGELOG.md # packages/realtime-api/package.json # packages/web-api/CHANGELOG.md # packages/web-api/package.json
- Remove browser-js workflows (production and staging) - Remove realtime-api workflows (production and staging) - Update unit-tests.yml to only run browser-client workflows - Remove stack tests that reference deleted realtime-api package - Add --passWithNoTests flag to test scripts to handle empty test suites This focuses the CI/CD pipeline on the @signalwire/client package only.
- Fix test file path: buildVideoWithCallSDK.spec.ts -> buildVideoWithFabricSDK.spec.ts - Add correct path prefixes for callfabric tests (callfabric/*.spec.ts) - Fix renegotiation test paths to include callfabric/ prefix - Disable relayApp.spec.ts test that depends on removed @signalwire/realtime-api These configuration mismatches were causing e2e workflow failures.
This reverts commit e6537bf.
Merging the type renames for @signalwire/client back to the original repository
# Conflicts: # internal/e2e-js/fixtures.ts # internal/e2e-js/package.json # internal/e2e-js/playwright.config.ts # internal/e2e-js/tests/buildVideoWithVideoSDK.spec.ts # internal/e2e-js/tests/callfabric/agentCustomer.spec.ts # internal/e2e-js/tests/roomSession.spec.ts # internal/e2e-js/tests/roomSessionAudienceCount.spec.ts # internal/e2e-js/tests/roomSessionAutomaticStream.spec.ts # internal/e2e-js/tests/roomSessionBadNetwork.spec.ts # internal/e2e-js/tests/roomSessionCleanup.spec.ts # internal/e2e-js/tests/roomSessionDemote.spec.ts # internal/e2e-js/tests/roomSessionDemoteAudience.spec.ts # internal/e2e-js/tests/roomSessionDemotePromote.spec.ts # internal/e2e-js/tests/roomSessionDemoteReattachPromote.spec.ts # internal/e2e-js/tests/roomSessionDevices.spec.ts # internal/e2e-js/tests/roomSessionFollowLeader.spec.ts # internal/e2e-js/tests/roomSessionJoinFrom.spec.ts # internal/e2e-js/tests/roomSessionJoinUntil.spec.ts # internal/e2e-js/tests/roomSessionLocalStream.spec.ts # internal/e2e-js/tests/roomSessionLockUnlock.spec.ts # internal/e2e-js/tests/roomSessionMaxMembers.spec.ts # internal/e2e-js/tests/roomSessionMethodsOnNonExistingMembers.spec.ts # internal/e2e-js/tests/roomSessionMultipleStreams.spec.ts # internal/e2e-js/tests/roomSessionPromoteDemote.spec.ts # internal/e2e-js/tests/roomSessionPromoteMeta.spec.ts # internal/e2e-js/tests/roomSessionPromoteParticipant.spec.ts # internal/e2e-js/tests/roomSessionPromoteReattachDemote.spec.ts # internal/e2e-js/tests/roomSessionRaiseHand.spec.ts # internal/e2e-js/tests/roomSessionReattach.spec.ts # internal/e2e-js/tests/roomSessionReattachBadAuth.spec.ts # internal/e2e-js/tests/roomSessionReattachMultiple.spec.ts # internal/e2e-js/tests/roomSessionReattachScreenshare.spec.ts # internal/e2e-js/tests/roomSessionReattachWrongCallId.spec.ts # internal/e2e-js/tests/roomSessionReattachWrongProtocol.spec.ts # internal/e2e-js/tests/roomSessionRemoveAllMembers.spec.ts # internal/e2e-js/tests/roomSessionStreaming.spec.ts # internal/e2e-js/tests/roomSessionStreamingAPI.spec.ts # internal/e2e-js/tests/roomSessionTalkingEventsParticipant.spec.ts # internal/e2e-js/tests/roomSessionTalkingEventsToAudience.spec.ts # internal/e2e-js/tests/roomSessionUnauthorized.spec.ts # internal/e2e-js/tests/roomSessionUpdateMedia.spec.ts # internal/e2e-js/tests/roomSettings.spec.ts # internal/e2e-js/utils.ts # packages/js/src/fabric/FabricRoomSession.ts # packages/js/src/fabric/utils/validationProxy.ts # packages/js/src/fabric/utils/validators.ts
- Copy playground-js to playground-client - Remove non-fabric samples (chat, pubSub, video, videoManager) - Update imports to use @signalwire/client instead of @signalwire/js - Add Vite configuration for proper module resolution - Update e2e-client to use playground-client 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Apply Vite configuration fixes to properly resolve @signalwire/client modules - Update blank template to explicitly import and expose SignalWire exports - Add module aliases, optimization, and process definitions for browser compatibility - This ensures window._SWJS is properly populated during e2e tests The combination of playground-client and these fixes resolves the module loading issue. 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Remove direct dependency on @signalwire/realtime-api in test file - Create relayAppWorker.js to execute realtime-api operations in Node.js context - Add relayAppClient fixture to manage Node.js child processes - Install @signalwire/realtime-api as dev dependency from npm registry - Update all three test cases to use the new fixture pattern - Maintain same test assertions and behavior This change isolates the realtime-api package execution to a separate Node.js process, allowing the tests to work without importing the Node.js-only package directly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Co-authored-by: Ammar Ansari <[email protected]>
Co-authored-by: Ammar Ansari <[email protected]>
Co-authored-by: Ammar Ansari <[email protected]>
Co-authored-by: Ammar Ansari <[email protected]>
Implements comprehensive device monitoring system with: - DeviceMonitor class with EventEmitter-based architecture - Continuous device change detection (added, removed, changed) - Polling mechanism with configurable 2-second default interval - Native devicechange event support with 100ms debouncing - Visibility and focus change handling for improved reliability - Browser compatibility with graceful degradation - Proper cleanup and memory management - Comprehensive test suite with 36 passing tests Device monitoring features: - Real-time device enumeration and comparison - Multiple monitoring strategies (native events + polling fallback) - Configurable options for polling interval, debouncing, and event handling - Events: device.change, device.added, device.removed, device.changed - Monitor lifecycle events: monitor.started, monitor.stopped, monitor.error Integration with existing DeviceManager: - Enhanced types with DeviceChangeEvent, DeviceChanges, DeviceMonitorEvents - Exported DeviceMonitor and DeviceMonitorOptions from device module - All existing DeviceManager tests continue to pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add DeviceRecoveryEngine.ts with advanced device recovery capabilities: - Multiple recovery strategies: exact ID, label match, same-type fallback, OS default - Priority-based strategy execution with confidence scoring - Comprehensive event system using EventEmitter from @signalwire/core - Debouncing, concurrent recovery management, and history tracking - Configurable options and custom strategy registration - Device availability verification and error handling - Add comprehensive test suite (49 tests) covering: - All recovery strategies and their edge cases - Event system functionality and error handling - Strategy management and configuration options - Device types, cleanup, and integration scenarios - Update types.ts with DeviceRecoveryEngine type definitions: - RecoveryStatus enum and comprehensive interfaces - Recovery strategy definitions and result types - Event interfaces and configuration options - Fix TypeScript compilation issues: - Import/export corrections for enum usage - Parameter signature improvements - Unused parameter warnings resolution 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add comprehensive changeset for device preference management system. Includes: - DeviceManager, DeviceMonitor, DeviceRecoveryEngine classes - Redux/Saga integration with BaseRoomSession - Zero breaking changes with backward compatibility - Comprehensive testing (434 passing tests) - Full TypeScript support 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🦋 Changeset detectedLatest commit: 029e8de The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
# Conflicts: # internal/e2e-client/package.json # internal/e2e-client/templates/blank/index.js # internal/playground-client/src/fabric-callee/index.html # internal/playground-client/src/unified/index.html # internal/playground-js/src/fabric/index.html # package-lock.json # packages/client/src/Client.ts # packages/client/src/VideoOverlays.ts # packages/client/src/buildVideoElement.test.ts # packages/client/src/buildVideoElement.ts # packages/client/src/index.ts # packages/client/src/unified/CallSession.test.ts # packages/client/src/unified/CallSession.ts # packages/client/src/unified/CallSessionMember.ts # packages/client/src/unified/Conversation.test.ts # packages/client/src/unified/Conversation.ts # packages/client/src/unified/ConversationAPI.ts # packages/client/src/unified/HTTPClient.test.ts # packages/client/src/unified/HTTPClient.ts # packages/client/src/unified/IncomingCallManager.test.ts # packages/client/src/unified/IncomingCallManager.ts # packages/client/src/unified/SATSession.test.ts # packages/client/src/unified/SATSession.ts # packages/client/src/unified/SignalWire.test.ts # packages/client/src/unified/SignalWire.ts # packages/client/src/unified/WSClient.ts # packages/client/src/unified/createHttpClient.ts # packages/client/src/unified/createWSClient.ts # packages/client/src/unified/index.ts # packages/client/src/unified/interfaces/address.ts # packages/client/src/unified/interfaces/capabilities.ts # packages/client/src/unified/interfaces/conversation.ts # packages/client/src/unified/interfaces/device.ts # packages/client/src/unified/interfaces/httpClient.ts # packages/client/src/unified/interfaces/incomingCallManager.ts # packages/client/src/unified/interfaces/index.ts # packages/client/src/unified/interfaces/wsClient.ts # packages/client/src/unified/utils/capabilitiesHelpers.test.ts # packages/client/src/unified/utils/capabilitiesHelpers.ts # packages/client/src/unified/utils/constants.ts # packages/client/src/unified/utils/eventMappers.ts # packages/client/src/unified/utils/typeGuard.ts # packages/client/src/unified/utils/validationProxy.ts # packages/client/src/unified/utils/validators.ts # packages/client/src/unified/workers/callJoinWorker.ts # packages/client/src/unified/workers/callLeftWorker.ts # packages/client/src/unified/workers/callSegmentWorker.ts # packages/client/src/unified/workers/conversationWorker.ts # packages/client/src/unified/workers/fabricMemberWorker.ts # packages/client/src/unified/workers/fabricWorker.ts # packages/client/src/unified/workers/index.ts # packages/client/src/unified/workers/wsClientWorker.ts # packages/client/src/utils/interfaces/fabric.ts # packages/client/src/utils/paginatedResult.ts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive Device Preference Management System for the SignalWire JavaScript SDK The system provides advanced device management capabilities while maintaining complete backward compatibility and zero overhead when disabled.
🎯 Key Features
🏗️ Architecture Components
Core Classes
DeviceManager: Central device preference management with EventEmitter + Redux integrationDeviceMonitor: Real-time device enumeration and change detectionDeviceRecoveryEngine: Automatic device failure recovery with configurable strategiesDevicePreferenceStorage: Pluggable storage adapters (LocalStorage, Memory, Custom)Integration Points
BaseRoomSession: Enhanced device methods with optional preference managementdevicePreferenceWorker: Redux saga worker following SDK patterns📦 Package Changes
@signalwire/client
@signalwire/core
🔧 Implementation Highlights
Lazy Initialization Pattern
Enhanced Device Methods (Backward Compatible)
Redux/Saga Architecture Compliance
🧪 Testing & Quality
Test Coverage
🔄 Migration & Backward Compatibility
Zero Breaking Changes
devicePreferencesconfig is omittedMigration Path
devicePreferencesconfig to enable new features📂 Major File Changes
New Files
packages/client/src/device/DeviceManager.ts- Core device preference managementpackages/client/src/device/DeviceMonitor.ts- Device monitoring and change detectionpackages/client/src/device/DeviceRecoveryEngine.ts- Automatic recovery systempackages/client/src/device/DevicePreferenceStorage.ts- Storage adapter implementationspackages/client/src/video/workers/devicePreferenceWorker.ts- Redux saga workerpackages/client/examples/device-preference-integration.js- Complete usage examplesEnhanced Files
packages/client/src/BaseRoomSession.ts- Device preference integrationpackages/client/src/index.ts- New exports for device management🚀 Usage Examples
Basic Integration
Advanced Device Management
🎯 Benefits
📋 Before Merge Checklist
🔗 Related Documentation
DEVICE_PREFERENCE_IMPLEMENTATION_COMPLETION.mdDEVICE_PREFERENCE_INTEGRATION.mdpackages/client/examples/device-preference-integration.jsThis PR represents a significant enhancement to the SignalWire SDK's device management capabilities while maintaining complete backward compatibility. The implementation follows all established architectural patterns and provides a robust foundation for advanced device preference management.