Skip to content

Fix SecureSettings cache race during manager initialization#4620

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intomainfrom
fix-securesettings-race
Apr 20, 2026
Merged

Fix SecureSettings cache race during manager initialization#4620
Gabriel Dufresne (GabrielDuf) merged 1 commit intomainfrom
fix-securesettings-race

Conversation

@mamoreau-devolutions
Copy link
Copy Markdown
Contributor

Summary

  • replace the SecureSettings cache with a thread-safe ConcurrentDictionary
  • invalidate cached entries with TryRemove when secure settings change
  • add regression coverage for concurrent cache misses in SecureSettings

Validation

  • dotnet test UniGetUI.sln --verbosity q --nologo
  • dotnet test UniGetUI.Core.Settings.Tests\UniGetUI.Core.Settings.Tests.csproj --verbosity q --nologo
  • dotnet build UniGetUI\UniGetUI.csproj -c Debug -p:Platform=x64 -v minimal -nologo

Closes #4609

Replace the SecureSettings cache with ConcurrentDictionary so parallel package manager initialization cannot corrupt shared state.

Add regression coverage for concurrent cache misses in SecureSettings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 8bf6235 into main Apr 20, 2026
1 check passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the fix-securesettings-race branch April 20, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Race condition in SecureSettings causes npm, PowerShell 5, and .NET Tool managers to fail initialization

2 participants