Skip to content

Propagate cancellation tokens through the installer engine and the Config app - #5753

Merged
johnsimons merged 1 commit into
masterfrom
john/cancel_p7_installer_config
Aug 13, 2026
Merged

Propagate cancellation tokens through the installer engine and the Config app#5753
johnsimons merged 1 commit into
masterfrom
john/cancel_p7_installer_config

Conversation

@johnsimons

Copy link
Copy Markdown
Member

Retires the cancellation analyzer debt blocks in ServiceControlInstaller.Engine,
ServiceControl.Management.PowerShell and ServiceControl.Config.Tests, and
narrows the ServiceControl.Config block to the one boundary that cannot
carry a token. Phase 7 of the propagation work.

The engine change is what forces these projects to move together.
AbstractCommandChecks' eight abstract members take tokens, the prompt
callback becomes Func<PathInfo, CancellationToken, Task> throughout
PathsValidator, the installable bases and the unattended installers, and
ValidateNewInstance loses params so the token can be last. PowerShell's
PowerShellCommandChecks and the three New-*Instance cmdlets follow, along
with the Config app's ScmuCommandChecks, InstallerModule and add
attachments.

Two token drops are fixed in the Config app's Caliburn layer. RxScreen
received a CancellationToken in ActivateAsync and DeactivateAsync and
discarded it instead of passing it to OnInitialize, OnActivate and
OnDeactivate; RxConductorBase did the same in ActivateItemAsync and
DeactivateItemAsync. Both now forward it, so screen activation is
cancellable.

Command bodies reached through ReactiveCommand.CreateFromTask now take a
required token, which binds its Func<CancellationToken, Task> overload
and gives them a real one. Config's own Command.Create path bottoms out
in System.Windows.Input.ICommand.Execute, which returns void and has no
token to offer, so those command types keep a file-scoped block that says
so, and their call sites pass CancellationToken.None explicitly.

Caliburn's IClose.TryCloseAsync and IEventAggregator declare no token and
cannot be changed, so those are inline pragmas rather than fixes.

@johnsimons
johnsimons requested a review from rbev August 12, 2026 21:22
@johnsimons johnsimons self-assigned this Aug 12, 2026
Base automatically changed from john/cancel_phase6 to master August 13, 2026 03:40
…nfig app

Retires the cancellation analyzer debt blocks in ServiceControlInstaller.Engine,
ServiceControl.Management.PowerShell and ServiceControl.Config.Tests, and
narrows the ServiceControl.Config block to the one boundary that cannot
carry a token. Phase 7 of the propagation work.

The engine change is what forces these projects to move together.
AbstractCommandChecks' eight abstract members take tokens, the prompt
callback becomes Func<PathInfo, CancellationToken, Task<bool>> throughout
PathsValidator, the installable bases and the unattended installers, and
ValidateNewInstance loses params so the token can be last. PowerShell's
PowerShellCommandChecks and the three New-*Instance cmdlets follow, along
with the Config app's ScmuCommandChecks, InstallerModule and add
attachments.

Two token drops are fixed in the Config app's Caliburn layer. RxScreen
received a CancellationToken in ActivateAsync and DeactivateAsync and
discarded it instead of passing it to OnInitialize, OnActivate and
OnDeactivate; RxConductorBase did the same in ActivateItemAsync and
DeactivateItemAsync. Both now forward it, so screen activation is
cancellable.

Command bodies reached through ReactiveCommand.CreateFromTask now take a
required token, which binds its Func<CancellationToken, Task> overload
and gives them a real one. Config's own Command.Create path bottoms out
in System.Windows.Input.ICommand.Execute, which returns void and has no
token to offer, so those command types keep a file-scoped block that says
so, and their call sites pass CancellationToken.None explicitly.

Caliburn's IClose.TryCloseAsync and IEventAggregator declare no token and
cannot be changed, so those are inline pragmas rather than fixes.
@johnsimons
johnsimons force-pushed the john/cancel_p7_installer_config branch from 0b7ec75 to 5945faf Compare August 13, 2026 03:56
@johnsimons
johnsimons merged commit e42c235 into master Aug 13, 2026
156 of 158 checks passed
@johnsimons
johnsimons deleted the john/cancel_p7_installer_config branch August 13, 2026 06:18
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