Feature/dotnet10 upgrade - #2
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Upgrades the OrbitalDocking Avalonia/.NET application and its CI pipeline to .NET 10, along with related dependency updates and a few runtime/test stability tweaks.
Changes:
- Upgrade projects, CI workflows, and README references from .NET 9 to .NET 10, plus dependency bumps.
- Add disposal-guard logic to periodic refresh routines in
MainWindowViewModeland adjust container stats progress reporting. - Update/extend Golden Path tests and introduce a solution file for easier IDE workflows.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ViewModels/MainWindowViewModel.cs | Adds _disposed guards around refresh methods and sets _disposed in Dispose() |
| ViewModels/ContainerViewModel.cs | Switches to a synchronous IProgress<T> implementation for container stats collection |
| README.md | Updates badges and prerequisites to .NET 10 |
| OrbitalDocking.csproj | Targets net10.0 and updates package references |
| OrbitalDocking.Tests/OrbitalDocking.Tests.csproj | Targets net10.0 and updates test dependencies |
| OrbitalDocking.Tests/GoldenPath/ViewModelTests.cs | Adds logger mock + default docker service setups; adds dispose-during-refresh test |
| OrbitalDocking.Tests/GoldenPath/CoreFunctionalityTests.cs | Fixes FluentAssertions API usage |
| Orbital.sln | Adds a Visual Studio solution file referencing app + tests |
| .github/workflows/release.yml | Updates CI .NET version to 10.0.x |
| .github/workflows/build.yml | Updates CI .NET version to 10.0.x |
Comments suppressed due to low confidence (5)
ViewModels/MainWindowViewModel.cs:904
- Same disposal race as other refresh methods:
_disposedcan flip and the semaphore can be disposed between the initial check andWaitAsync(0), which can still throw. Prefer cancel/await in-flight refreshes before disposing semaphores, or avoid disposing the semaphores entirely and just stop scheduling refreshes.
if (_disposed) return;
// Try to acquire the semaphore, skip if already refreshing
if (!await _volumeSemaphore.WaitAsync(0))
return;
try
{
IsLoading = true;
var result = await _dockerService.GetVolumesAsync();
ViewModels/MainWindowViewModel.cs:953
- Same disposal race as other refresh methods:
Dispose()can dispose_networkSemaphoreafter the_disposedcheck but beforeWaitAsync(0), leading toObjectDisposedException. Consider a coordinated shutdown (CTS + await in-flight tasks) and/or not disposing semaphores.
if (_disposed) return;
// Try to acquire the semaphore, skip if already refreshing
if (!await _networkSemaphore.WaitAsync(0))
return;
try
{
IsLoading = true;
var result = await _dockerService.GetNetworksAsync();
ViewModels/MainWindowViewModel.cs:1124
- Setting
_disposed = trueand immediately disposing subscriptions/cache/semaphores can still race with in-flight refresh tasks (timers/event subscriptions use async callbacks that are not awaited/cancelled). This can cause refresh code to touch_containerCache/collections after they’re disposed. Consider: dispose subscriptions first to stop new triggers, signal cancellation via a viewmodel CTS, then wait for any in-flight refresh operations to finish (or guard post-await work with_disposedchecks) before disposing_containerCache/semaphores.
_disposed = true;
_themeService.ThemeChanged -= OnThemeChanged;
_dockerService?.StopMonitoringEvents();
_subscriptions?.Dispose();
ViewModels/MainWindowViewModel.cs:288
- The
_disposedcheck does not fully preventObjectDisposedException:Dispose()can run after the check but before/whileWaitAsync(0)executes, andDispose()currently disposes the semaphores. Consider either (a) not disposing the semaphores at all, or (b) ensuring disposal only happens after all refresh loops have stopped/finished (e.g., cancel with a CTS and await in-flight refreshes), or (c) wrappingWaitAsync/Releaseintry/catch (ObjectDisposedException)and re-checking_disposedafter awaited service calls before touching_containerCache/UI state.
if (_disposed) return;
// Try to acquire the semaphore, skip if already refreshing
if (!await _containerSemaphore.WaitAsync(0))
return;
try
{
IsLoading = true;
var result = await _dockerService.GetContainersAsync();
ViewModels/MainWindowViewModel.cs:868
- Same disposal race as
RefreshContainersAsync: between the_disposedcheck and_imageSemaphore.WaitAsync(0),Dispose()can dispose the semaphore and causeWaitAsyncto throw. Also consider re-checking_disposedafterawait _dockerService.GetImagesAsync()and beforeDispatcher.UIThread.InvokeAsync(...)to avoid updating UI after disposal.
if (_disposed) return;
// Try to acquire the semaphore, skip if already refreshing
if (!await _imageSemaphore.WaitAsync(0))
return;
try
{
IsLoading = true;
var result = await _dockerService.GetImagesAsync();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Dotnet 10 upgrade, some clean up.