Replace fire-and-forget ConfigureAwait(false) with explicit discards#3441
Merged
Conversation
Agent-Logs-Url: https://github.com/BornToBeRoot/NETworkManager/sessions/de1121de-997a-4477-a250-f6c05615ddd5 Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BornToBeRoot/NETworkManager/sessions/de1121de-997a-4477-a250-f6c05615ddd5 Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
BornToBeRoot
May 24, 2026 00:03
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes “fire-and-forget” async invocation patterns across the WPF app by replacing non-awaited calls that ended in .ConfigureAwait(false) with explicit discard assignments (_ = ...), improving clarity without altering awaited/async flows.
Changes:
- Replaced standalone
SomeAsync().ConfigureAwait(false);statements with_ = SomeAsync();across views, controls, view models, and dialog flows. - Updated various
RelayCommandexecute delegates to use block-bodied lambdas that explicitly discard returnedTasks. - Applied the cleanup consistently across startup/load paths, command handlers, profile dialogs, and reconnect/connect flows.
Reviewed changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Source/NETworkManager/Views/PingMonitorView.xaml.cs | Use explicit discard for fire-and-forget export. |
| Source/NETworkManager/Views/PingMonitorHostView.xaml.cs | Use explicit discard for fire-and-forget start. |
| Source/NETworkManager/ViewModels/WiFiViewModel.cs | Convert fire-and-forget scan/load/export calls to discards; adjust command delegates. |
| Source/NETworkManager/ViewModels/WhoisViewModel.cs | Convert query/export fire-and-forget calls to discards. |
| Source/NETworkManager/ViewModels/WhoisHostViewModel.cs | Convert profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/WebConsoleSettingsViewModel.cs | Convert delete browsing data call to discard. |
| Source/NETworkManager/ViewModels/WebConsoleHostViewModel.cs | Convert connect + profile dialog calls to discards. |
| Source/NETworkManager/ViewModels/WakeOnLANViewModel.cs | Convert wake-up + profile dialog calls to discards. |
| Source/NETworkManager/ViewModels/TracerouteViewModel.cs | Convert start/export fire-and-forget calls to discards. |
| Source/NETworkManager/ViewModels/TracerouteHostViewModel.cs | Convert profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/TigerVNCSettingsViewModel.cs | Convert configure fire-and-forget call to discard. |
| Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs | Convert connect + profile dialog + add-tab connect calls to discards. |
| Source/NETworkManager/ViewModels/SubnetCalculatorSubnettingViewModel.cs | Convert calculate/export command fire-and-forget to discards. |
| Source/NETworkManager/ViewModels/SNTPLookupViewModel.cs | Convert export fire-and-forget call to discard. |
| Source/NETworkManager/ViewModels/SNTPLookupSettingsViewModel.cs | Convert add/edit/delete server calls to discards. |
| Source/NETworkManager/ViewModels/SNMPViewModel.cs | Convert open selection/export calls to discards. |
| Source/NETworkManager/ViewModels/SNMPSettingsViewModel.cs | Convert add/edit/delete OID profile calls to discards. |
| Source/NETworkManager/ViewModels/SNMPHostViewModel.cs | Convert profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/SettingsSettingsViewModel.cs | Convert async command invocations to discards via block lambdas. |
| Source/NETworkManager/ViewModels/SettingsProfilesViewModel.cs | Convert async command invocations to discards via block lambdas. |
| Source/NETworkManager/ViewModels/RemoteDesktopHostViewModel.cs | Convert connect/profile actions + add-tab connect call to discards. |
| Source/NETworkManager/ViewModels/PuTTYSettingsViewModel.cs | Convert configure fire-and-forget call to discard. |
| Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs | Convert connect/profile actions + add-tab connect call to discards. |
| Source/NETworkManager/ViewModels/ProfilesViewModel.cs | Convert profile/group dialog show calls to discards. |
| Source/NETworkManager/ViewModels/PowerShellSettingsViewModel.cs | Convert configure fire-and-forget call to discard. |
| Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs | Convert connect/profile actions + add-tab connect call to discards. |
| Source/NETworkManager/ViewModels/PortScannerViewModel.cs | Convert start/open selection/export calls to discards. |
| Source/NETworkManager/ViewModels/PortScannerSettingsViewModel.cs | Convert add/edit/delete port profile calls to discards. |
| Source/NETworkManager/ViewModels/PortScannerHostViewModel.cs | Convert profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/PingMonitorHostViewModel.cs | Convert start + profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/NetworkInterfaceViewModel.cs | Convert fire-and-forget load/export/apply/actions to discards; update async command delegates. |
| Source/NETworkManager/ViewModels/NetworkConnectionWidgetViewModel.cs | Convert fire-and-forget check call to discard. |
| Source/NETworkManager/ViewModels/NeighborTableViewModel.cs | Convert refresh/export/modify/admin commands to discards via block lambdas. |
| Source/NETworkManager/ViewModels/LookupPortViewModel.cs | Convert lookup/export command invocations to discards via block lambdas. |
| Source/NETworkManager/ViewModels/LookupOUILookupViewModel.cs | Convert export command invocation to discard via block lambda. |
| Source/NETworkManager/ViewModels/ListenersViewModel.cs | Convert refresh/export command invocations to discards via block lambdas. |
| Source/NETworkManager/ViewModels/IPScannerViewModel.cs | Convert start/detect/custom/export fire-and-forget calls to discards. |
| Source/NETworkManager/ViewModels/IPScannerSettingsViewModel.cs | Convert delete custom command call to discard. |
| Source/NETworkManager/ViewModels/IPScannerHostViewModel.cs | Convert profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs | Convert query/export fire-and-forget calls to discards. |
| Source/NETworkManager/ViewModels/IPGeolocationHostViewModel.cs | Convert profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs | Convert fire-and-forget check call to discard. |
| Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs | Convert fire-and-forget check call to discard. |
| Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs | Convert refresh/export/modify/admin/open commands to discards; update file-changed handler. |
| Source/NETworkManager/ViewModels/FirewallViewModel.cs | Convert refresh + rule/profile/admin/export/open commands to discards via block lambdas. |
| Source/NETworkManager/ViewModels/DNSLookupViewModel.cs | Convert query/export fire-and-forget calls to discards. |
| Source/NETworkManager/ViewModels/DNSLookupSettingsViewModel.cs | Convert add/edit/delete DNS server calls to discards. |
| Source/NETworkManager/ViewModels/DNSLookupHostViewModel.cs | Convert profile dialog show calls to discards. |
| Source/NETworkManager/ViewModels/DiscoveryProtocolViewModel.cs | Convert admin/capture/export command invocations to discards via block lambdas. |
| Source/NETworkManager/ViewModels/ConnectionsViewModel.cs | Convert refresh/export command invocations to discards via block lambdas. |
| Source/NETworkManager/ViewModels/BitCalculatorViewModel.cs | Convert export command invocation to discard via block lambda. |
| Source/NETworkManager/ProfileDialogManager.cs | Convert nested dialog transitions to explicit discards; adjust back callback to fire-and-forget. |
| Source/NETworkManager/Controls/TigerVNCControl.xaml.cs | Convert connect/reconnect fire-and-forget calls to discards. |
| Source/NETworkManager/Controls/PuTTYControl.xaml.cs | Convert connect/reconnect fire-and-forget calls to discards. |
| Source/NETworkManager/Controls/PowerShellControl.xaml.cs | Convert connect/reconnect fire-and-forget calls to discards. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private void Renew6Action() | ||
| { | ||
| ReleaseRenewAsync(IPConfigReleaseRenewMode.Renew).ConfigureAwait(false); | ||
| _ = ReleaseRenewAsync(IPConfigReleaseRenewMode.Renew); |
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.
Changes proposed in this pull request
.ConfigureAwait(false)with explicit discard assignments.ConfigureAwait(false)has no effect when the task is not awaited._ = SomeAsyncOperation();makes the intent to ignore the task explicit.Related issue(s)
Copilot generated summary
This change standardizes fire-and-forget async usage across the WPF codebase by replacing non-awaited
.ConfigureAwait(false)calls with explicit discards. Awaited async paths are left intact; only intentionally ignored tasks were updated.Copilot summary
What changed
with:
Where it changed
Why this matters
To-Do
Contributing
By submitting this pull request, I confirm the following: