Skip to content

CA2007 and set streamer mic device - #7

Merged
DataNext27 merged 2 commits into
mainfrom
dev
Aug 30, 2026
Merged

CA2007 and set streamer mic device#7
DataNext27 merged 2 commits into
mainfrom
dev

Conversation

@DataNext27

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 30, 2026 15:19
@DataNext27
DataNext27 merged commit efc69e6 into main Aug 30, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It introduces breaking changes to the public API surface (public interface method addition and a positional record signature change) that should be redesigned for compatibility or explicitly treated as a major/breaking release.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the SteelSeries Sonar .NET library to (1) enforce CA2007 library-await behavior by consistently using ConfigureAwait(false) within the core library project, and (2) add support for routing the streamer-mode mic passthrough device plus corresponding event diffing and tests.

Changes:

  • Enforced CA2007 in SteelSeriesAPI via a library-scoped .editorconfig and updated awaits to use ConfigureAwait(false).
  • Added a mic passthrough redirection route + SetMicDeviceAsync API surface and a corresponding Explorer/Sample usage.
  • Extended redirection change diffing to detect mic device changes and added test coverage.
File summaries
File Description
SteelSeriesAPI/SteelSeriesAPI.csproj Bumps package version to 2.0.0-alpha.2.
SteelSeriesAPI/Sonar/SonarRoutes.cs Adds a dedicated route builder for mic passthrough device redirection.
SteelSeriesAPI/Sonar/Managers/VolumeSettingsManager.cs Adds ConfigureAwait(false) to library awaits.
SteelSeriesAPI/Sonar/Managers/RedirectionsManager.cs Adds SetMicDeviceAsync implementation and applies ConfigureAwait(false) to awaits.
SteelSeriesAPI/Sonar/Managers/ModeManager.cs Applies ConfigureAwait(false) throughout mode get/set + polling loop.
SteelSeriesAPI/Sonar/Managers/IRedirectionsManager.cs Adds SetMicDeviceAsync to the public redirections interface.
SteelSeriesAPI/Sonar/Managers/ConfigManager.cs Adds ConfigureAwait(false) to library awaits.
SteelSeriesAPI/Sonar/Managers/ChatMixManager.cs Adds ConfigureAwait(false) to library awaits.
SteelSeriesAPI/Sonar/Managers/AudioDeviceManager.cs Adds ConfigureAwait(false) to library awaits.
SteelSeriesAPI/Sonar/Managers/AppRoutingManager.cs Adds ConfigureAwait(false) to library awaits.
SteelSeriesAPI/Sonar/Events/SonarEventListener.cs Adds ConfigureAwait(false) to listener stop/connect/receive/delay awaits.
SteelSeriesAPI/Sonar/Events/RedirectionChanges.cs Adds MicDeviceChange and extends RedirectionDiff to include it.
SteelSeriesAPI/Sonar/Events/Listener/SonarEventListener.Volumes.cs Adds ConfigureAwait(false) in polling loop and refresh calls.
SteelSeriesAPI/Sonar/Events/Listener/SonarEventListener.Redirections.cs Raises a new MicDeviceChanged event and adds mic device diff logic.
SteelSeriesAPI/Sonar/Events/Listener/SonarEventListener.Configs.cs Adds ConfigureAwait(false) to selected-config refresh.
SteelSeriesAPI/Sonar/Events/Listener/DebouncedRefresher.cs Adds ConfigureAwait(false) to debounce/delay/lock awaits.
SteelSeriesAPI/Core/SonarHttpClient.cs Adds ConfigureAwait(false) and adjusts async stream disposal pattern.
SteelSeriesAPI/Core/ServerDiscovery.cs Adds ConfigureAwait(false) to GG subApps fetch.
SteelSeriesAPI/.editorconfig Introduces library-only CA2007 enforcement as an error.
SteelSeriesAPI.Tests/SonarEventListenerTests.cs Adds tests for mic device change detection in redirection diffs.
SteelSeriesAPI.Tests/RedirectionsManagerTests.cs Adds a test asserting the mic redirection route shape/escaping.
SteelSeriesAPI.Sample/Program.cs Demonstrates subscribing to MicDeviceChanged.
SteelSeriesAPI.Explorer/Program.cs Adds an end-to-end “mic device round-trip” explorer step.
Review details
  • Files reviewed: 23/23 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 23 to +31
/// <summary>Routes a streamer-mode mix to a different output device.</summary>
Task SetMixDeviceAsync(Mix mix, string deviceId, CancellationToken ct = default);

/// <summary>
/// Routes the streamer-mode mic passthrough to a different capture device.
/// </summary>
/// <param name="deviceId">The id of the capture device to capture the mic from.</param>
/// <param name="ct">A token to cancel the operation.</param>
Task SetMicDeviceAsync(string deviceId, CancellationToken ct = default);
Comment on lines 33 to +44
/// <summary>Everything that changed between two redirection snapshots.</summary>
public sealed record RedirectionDiff(
IReadOnlyList<ClassicDeviceChange> ClassicDeviceChanges,
IReadOnlyList<MixDeviceChange> MixDeviceChanges,
IReadOnlyList<MixChannelToggle> MixChannelToggles,
StreamMonitoringChange? MonitoringChange)
StreamMonitoringChange? MonitoringChange,
MicDeviceChange? MicDeviceChange)
{
/// <summary>True when nothing actually changed between the two snapshots.</summary>
public bool IsEmpty =>
ClassicDeviceChanges.Count == 0 && MixDeviceChanges.Count == 0 &&
MixChannelToggles.Count == 0 && MonitoringChange is null;
MixChannelToggles.Count == 0 && MonitoringChange is null && MicDeviceChange is null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants