fix: trace available devices and thermal state changes - #1866
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds device enumeration tracing functionality to track available media devices in trace logs. The implementation uses a new traceOnce mechanism to log device information without duplicating entries, and resets the trace when device changes are detected.
- Implements
traceOncefunctionality in the Tracer class to log device enumeration only once per key - Modifies the lazy helper to support parameterized factory functions for passing tracer instances
- Integrates device enumeration tracing into audio, video, and speaker device managers
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/client/src/stats/rtc/types.ts | Adds TraceKey type for categorizing trace operations |
| packages/client/src/stats/rtc/Tracer.ts | Implements traceOnce and resetTrace methods for controlled logging |
| packages/client/src/helpers/lazy.ts | Enhances lazy function to accept factory functions with parameters |
| packages/client/src/devices/devices.ts | Adds tracer parameter to device enumeration functions and implements tracing |
| packages/client/src/devices/SpeakerManager.ts | Passes tracer instance to audio output device enumeration |
| packages/client/src/devices/MicrophoneManager.ts | Passes tracer instance to audio device enumeration |
| packages/client/src/devices/CameraManager.ts | Passes tracer instance to video device enumeration |
… happened in ws.onclose
kristian-mkd
approved these changes
Jul 24, 2025
myandrienko
approved these changes
Jul 24, 2025
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
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.
💡 Overview
Adds the list of available devices to the trace log.