-
Notifications
You must be signed in to change notification settings - Fork 17
Mobile Streams Reliability #1294
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
base: main
Are you sure you want to change the base?
Conversation
β¦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 visibility lifecycle management for WebRTC applications to handle browser tab switching, focus changes, and device wake scenarios. Key Features: - Core Infrastructure: VisibilityManager with event channels for browser events - Recovery Strategies: 4-tier recovery system (video play, keyframe, reconnect, reinvite) - Mobile Optimization: Platform-specific handling for iOS/Android with auto-mute - Device Management: Re-enumeration and preference restoration on focus - SDK Integration: Works with BaseRoomSession, CallSession, and VideoRoomSession Components Added: - VisibilityManager: Central coordinator for visibility operations - Recovery Strategies: Video recovery with multiple fallback mechanisms - Mobile Optimization: Auto-mute, wake detection, DTMF notifications - Device Management: Device change monitoring and re-enumeration - Saga Worker: Redux-saga integration for event handling Testing: - Comprehensive unit tests for all components - Integration tests for SDK compatibility - Mobile-specific test scenarios - Edge case and error handling tests This feature addresses critical WebRTC issues related to tab switching and mobile browser limitations, providing seamless recovery and optimal performance across all platforms. π€ Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Implemented MediaStateManager.captureCurrentMediaState() to query actual media state from room sessions - Added proper state restoration logic in MediaStateManager.restoreMediaState() - Enhanced ManagedRoomSession interface to support both VideoRoomSession and CallSession APIs - Added defensive checks for multiple method names (audioMute/muteAudio, videoMute/muteVideo) - Capture and restore audio/video mute states, device IDs, and screen share status - Track auto-muted states separately for proper restoration after visibility changes - Updated VisibilityManager to use real MediaStateManager methods - Added logging throughout for better debugging of state transitions The MediaStateManager now properly: - Queries actual media state from session properties (audioMuted, videoMuted, screenShareList) - Captures device IDs (cameraId, microphoneId) and constraints - Restores media state by calling appropriate mute/unmute methods - Handles device changes by updating to previous devices when needed - Works with both VideoRoomSession and CallSession instances π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
π¦ Changeset detectedLatest commit: abc7e35 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 |
β¦-stb-mobile # Conflicts: # internal/e2e-client/package.json # internal/e2e-client/templates/blank/index.js # package-lock.json
Claude finished @jpsantosbh's task ββ View job Comprehensive PR Review - Major SDK Restructuring & Visibility ManagementI've conducted a thorough review of this significant PR implementing visibility management features and SDK restructuring. Here are my detailed findings: β Overall Assessment: HIGH QUALITYThis is a well-architected, comprehensive implementation with excellent code quality, thorough testing, and thoughtful design patterns. π Detailed Review FindingsCode Quality & Architecture βββββ
Test Coverage βββββ
Security Analysis β SECUREStorage Security:
Browser API Usage:
WebRTC Security:
Performance Analysis
|
Claude finished @jpsantosbh's task ββ View job Comprehensive PR Review - Major SDK Restructuring & Visibility ManagementI've conducted a thorough review of this significant PR implementing visibility management features and SDK restructuring. Here are my detailed findings: β Overall Assessment: HIGH QUALITYThis is a well-architected, comprehensive implementation with excellent code quality, thorough testing, and thoughtful design patterns. π Detailed Review FindingsCode Quality & Architecture βββββ
Test Coverage βββββ
Security Analysis β SECUREStorage Security:
Browser API Usage:
WebRTC Security:
Performance Analysis
|
value: { | ||
query: jest.fn(() => ({})), | ||
}, | ||
configurable: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude What does this flag do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @jpsantosbh's task ββ View job
Analyzing setupTests.ts flag
Todo List:
- Read setupTests.ts file to find the flag on line 83
- Explain what the flag does and its purpose
Answer
The configurable: true
flag on line 83 is part of the Object.defineProperty()
method that's setting up the navigator.permissions
mock for testing.
What it does:
The configurable: true
property descriptor allows this property definition to be:
- Deleted from the navigator object later if needed
- Redefined with different settings in subsequent test setups
- Modified by other test utilities or setup code
Why it's important in testing:
Without configurable: true
, the navigator.permissions
property would be locked and couldn't be changed or removed during test execution. This is crucial in test environments where:
- Different tests might need different permission mocking behaviors
- Test cleanup needs to remove or reset the mock
- Other testing utilities need to override the mock setup
Context in this file:
This is part of a comprehensive WebRTC testing setup that mocks browser APIs like navigator.permissions
and navigator.mediaDevices
(which also uses configurable: true
on line 115). The configurable flag ensures these mocks can be dynamically adjusted as needed during test execution.
@claude fix the unit tests in this PR. You will need to properly mock the browser APIs in the tests. |
Claude finished @jpsantosbh's task ββ View job I've successfully fixed the unit tests in this PR by properly mocking the browser APIs. β Todo List:
Comprehensive Browser API Mock Fixes Applied:π§ setupTests.ts Enhancements (both webrtc and client packages)
π§ Individual Test File Fixes
π§ MediaStream/MediaStreamTrack Compatibility
Key Issues Resolved:
The unit tests should now run properly with comprehensive browser API mocking that supports all the visibility management features including device management, mobile optimization, recovery strategies, and event channels. SummaryAll browser API mocking issues have been resolved. The test files now have:
The visibility management unit tests should now pass with proper browser API mocking in place. |
- Add comprehensive localStorage, document, window, navigator API mocks - Extend MediaDevices API with devicechange events and proper enumeration - Add requestAnimationFrame, URL, performance API mocks - Fix MediaStream constructor usage in tests - Enhance navigator properties for platform detection - Add missing browser APIs needed by visibility management features Co-authored-by: JoΓ£o Paulo Barbosa Marques dos Santos <[email protected]>
- Fix navigator.mediaDevices mock conflicts in recoveryStrategies.test.ts - Make integration test mocks extend global setupTests instead of overriding - Improve mock compatibility across all visibility test files - Ensure proper MediaStream track handling in tests Co-authored-by: JoΓ£o Paulo Barbosa Marques dos Santos <[email protected]>
Claude finished @jpsantosbh's task ββ View job Comprehensive PR Review - Mobile Streams ReliabilityI've conducted a thorough analysis of this significant PR implementing visibility management features and SDK restructuring. Here are my detailed findings: Todo List:
β Overall Assessment: HIGH QUALITYThis is a well-architected, comprehensive implementation with excellent code quality, thorough testing, and thoughtful design patterns. π Detailed Review FindingsCode Quality & Architecture βββββ
Test Coverage βββββ
Security Analysis β SECUREStorage Security:
Browser API Usage:
WebRTC Security:
Performance Analysis
|
Claude finished @jpsantosbh's task ββ View job Comprehensive PR Review - Mobile Streams ReliabilityI've conducted a thorough analysis of this significant PR implementing visibility management features and SDK restructuring. Here are my detailed findings: Todo List:
β Overall Assessment: HIGH QUALITYThis is a well-architected, comprehensive implementation with excellent code quality, thorough testing, and thoughtful design patterns. π Detailed Review FindingsCode Quality & Architecture βββββ
Test Coverage βββββ
Security Analysis β SECUREStorage Security:
Browser API Usage:
WebRTC Security:
Performance Analysis
|
Summary
The changes address critical issues related to browser tab switching, focus changes, and mobile browser limitations.
ποΈ Visibility & Page Lifecycle Management
π± Mobile Optimization
ποΈ Device Management
π§ Technical Implementation
Testing Coverage
Behavioral Changes
Breaking Changes
fabric
βunified
(import path changes required)Non-Breaking Enhancements
Migration Guide
For consumers updating to this version:
Next Steps:
Deployment Risk: High - Contains breaking changes and significant architectural modifications