[Windows] Address AppInstance activation lifecycle review feedback - #36597
Merged
kubaflo merged 1 commit intoJul 15, 2026
Merged
Conversation
IlGalvo
had a problem deploying
to
copilot-pat-pool
July 15, 2026 18:36 — with
GitHub Actions
Failure
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Hey there @@IlGalvo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
|
Hey there @IlGalvo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
kubaflo
merged commit Jul 15, 2026
144023a
into
dotnet:windows-app-activation-lifecycle
9 of 11 checks passed
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.
Summary
Follow-up to #34883 addressing the remaining review feedback without changing the public surface introduced by the parent PR.
AppInstance.Activatednotifications through the MAUI application dispatcher while keeping the initial activation synchronous and able to short-circuit window creation.Tests/Windows/layout.Threading and lifecycle behavior
MauiWinUIApplicationcaptures the application dispatcher after app-level services are available. Initial activation continues to run synchronously beforeOnLaunchingand window creation, preserving the existingbool handledcontract. Only laterAppInstance.Activatedcallbacks are dispatched when required; if dispatch is rejected during shutdown, the callback is not run off-thread.Test scope
The Android and iOS/MacCatalyst lifecycle tests added by the parent PR are intentionally removed:
OnStart/OnResumedelivery completes, creating a startup race.MauiTestApplicationDelegaterather than the normalMauiUIApplicationDelegatelifecycle path.Those files do not exist on
main, so this does not remove established MAUI coverage. Addressing the cross-platform runners belongs in a separate change.Intentional review decisions
AppInstancekeys. Single-instance apps preserve their own key and redirect protocol activations to the original instance, where the MAUI lifecycle callback completes WebAuthenticator. Throwing would break that supported pattern.System.Threading.Tasksremains in the Controls Sample because it provides the.AsTask()extension used withRedirectActivationToAsync.MauiProgramDefaultsremains unchanged becauseCore.DeviceTests.Sharedhas nullable annotations disabled; its optional delegate follows the existing project convention.Validation
Automated/local:
WebUtils_Tests: 20/20 passedManual Windows validation:
Android, iOS, and MacCatalyst runtime tests were not run for this Windows-only follow-up.
Thanks in advance,
@mattleibow
@kubaflo