Skip to content

refactor: pairing flow, pairing tests, and inline struct comments - #5602

Merged
ReenigneArcher merged 2 commits into
masterfrom
chore/sonar-fixes
Sep 3, 2026
Merged

refactor: pairing flow, pairing tests, and inline struct comments#5602
ReenigneArcher merged 2 commits into
masterfrom
chore/sonar-fixes

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Extracted getservercert handling into a dedicated pairing-session helper, tightened locking by switching shared mutex globals to accessor-backed statics, and cleaned up several C++ initializations/guards for clarity. Pairing IDs now use explicit hex alphabet generation, config HTTP cancel-pairing now catches JSON-specific exceptions, and test-only HTTP pairing entry points were added. Unit coverage was expanded substantially for HTTP pairing behavior (pending/cancel, duplicate/full capacity, console PIN success/failure/expiration), session removal, and client-auth state assertions.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@ReenigneArcher ReenigneArcher added this to the sonar milestone Sep 3, 2026
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@ReenigneArcher
ReenigneArcher marked this pull request as ready for review September 3, 2026 03:07
Extracted `getservercert` handling into a dedicated pairing-session helper, tightened locking by switching shared mutex globals to accessor-backed statics, and cleaned up several C++ initializations/guards for clarity. Pairing IDs now use explicit hex alphabet generation, config HTTP cancel-pairing now catches JSON-specific exceptions, and test-only HTTP pairing entry points were added. Unit coverage was expanded substantially for HTTP pairing behavior (pending/cancel, duplicate/full capacity, console PIN success/failure/expiration), session removal, and client-auth state assertions.
Add `///<` member-level documentation across config, networking, streaming, and platform-specific structs/unions (Linux VAAPI/audio and Windows input/display). This improves code clarity and satisfies stricter Doxygen coverage requirements without changing runtime behavior.
@ReenigneArcher ReenigneArcher changed the title refactor: pairing flow and expand tests refactor: pairing flow, pairing tests, and inline struct comments Sep 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.01980% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.26%. Comparing base (41c2571) to head (4404514).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/nvhttp.cpp 97.82% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5602      +/-   ##
==========================================
+ Coverage   36.84%   37.26%   +0.41%     
==========================================
  Files         104      104              
  Lines       25852    25880      +28     
  Branches    11420    11419       -1     
==========================================
+ Hits         9526     9644     +118     
+ Misses      13442    13428      -14     
+ Partials     2884     2808      -76     
Flag Coverage Δ
Archlinux 20.90% <80.00%> (+0.61%) ⬆️
FreeBSD-amd64 23.23% <45.65%> (+0.27%) ⬆️
Homebrew-macos-14 36.25% <84.09%> (+0.79%) ⬆️
Homebrew-macos-15 36.82% <82.95%> (+0.72%) ⬆️
Homebrew-macos-26 37.11% <93.18%> (+0.87%) ⬆️
Homebrew-ubuntu-24.04 24.90% <87.80%> (+0.63%) ⬆️
Linux-AppImage 24.33% <87.80%> (+0.63%) ⬆️
Windows-AMD64 30.03% <86.25%> (+0.71%) ⬆️
Windows-ARM64 25.18% <45.34%> (+0.31%) ⬆️
macOS-arm64 30.59% <43.82%> (?)
macOS-x86_64 31.20% <43.82%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/config.h 25.00% <ø> (ø)
src/confighttp.cpp 57.15% <100.00%> (ø)
src/input.cpp 48.02% <100.00%> (-0.05%) ⬇️
src/nvhttp.h 77.27% <100.00%> (ø)
src/platform/common.h 61.19% <ø> (+0.29%) ⬆️
src/platform/linux/audio.cpp 60.50% <100.00%> (ø)
src/platform/linux/vaapi.cpp 2.58% <ø> (ø)
src/platform/windows/display.h 33.33% <ø> (ø)
src/platform/windows/input.cpp 16.66% <ø> (ø)
src/stream.cpp 22.74% <ø> (ø)
... and 2 more

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41c2571...4404514. Read the comment docs.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Last Updated 2026-09-03 12:46:49 UTC
Source Run CI Run #5264
Commit 4404514893667c82d4374a3df52a5ea53164844f

Screenshot Comparison

PR #5602 screenshots vs screenshots baseline.

Matrix: AppImage

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

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.

1 participant