Skip to content

Fix NU1903 (Tmds.DBus.Protocol) and CS0162 build warnings#128

Merged
maraf merged 4 commits into
mainfrom
maraf/fix-nu1903-cs0162
Apr 22, 2026
Merged

Fix NU1903 (Tmds.DBus.Protocol) and CS0162 build warnings#128
maraf merged 4 commits into
mainfrom
maraf/fix-nu1903-cs0162

Conversation

@maraf

@maraf maraf commented Apr 22, 2026

Copy link
Copy Markdown
Member

Clears two build warnings so the Avalonia project builds clean.

Changes

  • NU1903 / GHSA-xrw6-gwf8-vvr9: Avalonia 11.3.13 transitively pulls Tmds.DBus.Protocol 0.21.2 (high-severity advisory on Linux). Added a direct PackageReference pinned to 0.21.3 (the patched version per the advisory) via central package management, so it overrides the vulnerable transitive version.
  • CS0162 in SnippetSearcher.Search: The SupplyChildrenFromSelectedSnippets block was gated by a const bool = false, making it unreachable. Per the TODO comment it was kept intentionally for future work, so the block is now commented out (with the TODO preserved) and the unused const removed.

Verified with dotnet build on the Avalonia project: 0 warnings, 0 errors.

maraf and others added 3 commits April 22, 2026 12:25
- Pin Tmds.DBus.Protocol to 0.21.3 to address GHSA-xrw6-gwf8-vvr9
  (transitive via Avalonia on Linux).
- Suppress CS0162 around the intentionally-dead branch in
  SnippetSearcher gated by the SupplyChildrenFromSelectedSnippets
  compile-time constant.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Pull request overview

This PR cleans up build output for the Avalonia app by addressing (1) a NuGet security advisory on a transitive dependency and (2) a C# unreachable-code warning in the core snippet search logic.

Changes:

  • Pins Tmds.DBus.Protocol to 0.21.3 via central package management and adds a direct reference in the Avalonia project to ensure the patched version is used.
  • Removes an unreachable code path in SnippetSearcher.Search that was gated by a const false flag (CS0162).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Neptuo.Productivity.SnippetManager/SnippetSearcher.cs Removes unreachable feature-flagged block to eliminate CS0162 warning.
src/Neptuo.Productivity.SnippetManager.Avalonia/Neptuo.Productivity.SnippetManager.Avalonia.csproj Adds direct PackageReference to Tmds.DBus.Protocol to force patched version selection.
src/Directory.Packages.props Adds centrally-managed version 0.21.3 for Tmds.DBus.Protocol.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Neptuo.Productivity.SnippetManager/SnippetSearcher.cs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@maraf maraf merged commit 2d951eb into main Apr 22, 2026
1 check passed
@maraf maraf deleted the maraf/fix-nu1903-cs0162 branch April 22, 2026 10:40
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