Repository navigation
[Windows] Fix CollectionView gesture compilation - #40335
Merged
Merged
Conversation
Use the existing RoutedEventArgs.SetHandled helper for tap event subtypes and explicitly reference WinUI ItemsView in native visual-tree traversal. Preserve the CollectionView gesture bubbling logic. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
temporarily deployed
to
copilot-pat-pool
November 17, 2026 14:48 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 17, 2026 14:48 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
kubaflo
temporarily deployed
to
copilot-pat-pool
November 17, 2026 14:49 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 17, 2026 14:51 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 17, 2026 14:53 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 17, 2026 14:53 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
/rebase |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Collaborator
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
1 task done
1 task
kubaflo
added a commit
that referenced
this pull request
Nov 17, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate #40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in #40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the test-host crash found while validating #40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated repair of candidate #40116, targeting `candidate/11.0.1xx-sr2`. ### Description of Change <!-- Enter description of the fix in this section --> Fix two Windows compilation errors introduced by #39917 in `GesturePlatformManager.Windows.cs`: - `OnTap` receives `RoutedEventArgs`, which has no `Handled` property (`CS1061`). Use the existing `SetHandled(true)` extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types. - The visual-tree traversal's unqualified `ItemsView` binds to the MAUI control, not the native WinUI control (`CS8121`). Explicitly name `Microsoft.UI.Xaml.Controls.ItemsView`. The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration. **Validation** The unchanged candidate reproduces both compiler errors in native build [1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504) and both UI sample builds in [1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501), including their in-job retries. The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was validated by the existing full `maui-pr` pipeline [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565). Both completed Windows build jobs report **Build succeeded / 0 errors**, and their raw logs contain the Controls outputs for **both** `net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`. Exact CI commands, both passed: ```text D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true ``` These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: [Debug 139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1), [Release 209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1). Local file-specific formatting check passed: ```text .dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet ``` **Not an all-green CI claim:** the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged `ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks call `TaskCompletionSource.SetResult` twice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair. Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open #38822 does not modify this source file. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the Windows compilation regression introduced by #39917; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate #40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in #40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the test-host crash found while validating #40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated repair of candidate #40116, targeting `candidate/11.0.1xx-sr2`. ### Description of Change <!-- Enter description of the fix in this section --> Fix two Windows compilation errors introduced by #39917 in `GesturePlatformManager.Windows.cs`: - `OnTap` receives `RoutedEventArgs`, which has no `Handled` property (`CS1061`). Use the existing `SetHandled(true)` extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types. - The visual-tree traversal's unqualified `ItemsView` binds to the MAUI control, not the native WinUI control (`CS8121`). Explicitly name `Microsoft.UI.Xaml.Controls.ItemsView`. The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration. **Validation** The unchanged candidate reproduces both compiler errors in native build [1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504) and both UI sample builds in [1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501), including their in-job retries. The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was validated by the existing full `maui-pr` pipeline [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565). Both completed Windows build jobs report **Build succeeded / 0 errors**, and their raw logs contain the Controls outputs for **both** `net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`. Exact CI commands, both passed: ```text D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true ``` These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: [Debug 139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1), [Release 209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1). Local file-specific formatting check passed: ```text .dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet ``` **Not an all-green CI claim:** the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged `ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks call `TaskCompletionSource.SetResult` twice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair. Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open #38822 does not modify this source file. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the Windows compilation regression introduced by #39917; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate #40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in #40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the test-host crash found while validating #40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated repair of candidate #40116, targeting `candidate/11.0.1xx-sr2`. ### Description of Change <!-- Enter description of the fix in this section --> Fix two Windows compilation errors introduced by #39917 in `GesturePlatformManager.Windows.cs`: - `OnTap` receives `RoutedEventArgs`, which has no `Handled` property (`CS1061`). Use the existing `SetHandled(true)` extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types. - The visual-tree traversal's unqualified `ItemsView` binds to the MAUI control, not the native WinUI control (`CS8121`). Explicitly name `Microsoft.UI.Xaml.Controls.ItemsView`. The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration. **Validation** The unchanged candidate reproduces both compiler errors in native build [1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504) and both UI sample builds in [1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501), including their in-job retries. The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was validated by the existing full `maui-pr` pipeline [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565). Both completed Windows build jobs report **Build succeeded / 0 errors**, and their raw logs contain the Controls outputs for **both** `net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`. Exact CI commands, both passed: ```text D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true ``` These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: [Debug 139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1), [Release 209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1). Local file-specific formatting check passed: ```text .dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet ``` **Not an all-green CI claim:** the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged `ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks call `TaskCompletionSource.SetResult` twice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair. Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open #38822 does not modify this source file. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the Windows compilation regression introduced by #39917; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate #40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in #40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the test-host crash found while validating #40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 19, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated repair of candidate #40116, targeting `candidate/11.0.1xx-sr2`. ### Description of Change <!-- Enter description of the fix in this section --> Fix two Windows compilation errors introduced by #39917 in `GesturePlatformManager.Windows.cs`: - `OnTap` receives `RoutedEventArgs`, which has no `Handled` property (`CS1061`). Use the existing `SetHandled(true)` extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types. - The visual-tree traversal's unqualified `ItemsView` binds to the MAUI control, not the native WinUI control (`CS8121`). Explicitly name `Microsoft.UI.Xaml.Controls.ItemsView`. The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration. **Validation** The unchanged candidate reproduces both compiler errors in native build [1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504) and both UI sample builds in [1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501), including their in-job retries. The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was validated by the existing full `maui-pr` pipeline [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565). Both completed Windows build jobs report **Build succeeded / 0 errors**, and their raw logs contain the Controls outputs for **both** `net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`. Exact CI commands, both passed: ```text D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true ``` These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: [Debug 139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1), [Release 209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1). Local file-specific formatting check passed: ```text .dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet ``` **Not an all-green CI claim:** the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged `ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks call `TaskCompletionSource.SetResult` twice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair. Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open #38822 does not modify this source file. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the Windows compilation regression introduced by #39917; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 19, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate #40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in #40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the test-host crash found while validating #40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 22, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated repair of candidate #40116, targeting `candidate/11.0.1xx-sr2`. ### Description of Change <!-- Enter description of the fix in this section --> Fix two Windows compilation errors introduced by #39917 in `GesturePlatformManager.Windows.cs`: - `OnTap` receives `RoutedEventArgs`, which has no `Handled` property (`CS1061`). Use the existing `SetHandled(true)` extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types. - The visual-tree traversal's unqualified `ItemsView` binds to the MAUI control, not the native WinUI control (`CS8121`). Explicitly name `Microsoft.UI.Xaml.Controls.ItemsView`. The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration. **Validation** The unchanged candidate reproduces both compiler errors in native build [1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504) and both UI sample builds in [1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501), including their in-job retries. The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was validated by the existing full `maui-pr` pipeline [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565). Both completed Windows build jobs report **Build succeeded / 0 errors**, and their raw logs contain the Controls outputs for **both** `net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`. Exact CI commands, both passed: ```text D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true ``` These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: [Debug 139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1), [Release 209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1). Local file-specific formatting check passed: ```text .dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet ``` **Not an all-green CI claim:** the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged `ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks call `TaskCompletionSource.SetResult` twice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair. Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open #38822 does not modify this source file. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the Windows compilation regression introduced by #39917; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 22, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate #40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in #40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the test-host crash found while validating #40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 23, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated repair of candidate #40116, targeting `candidate/11.0.1xx-sr2`. ### Description of Change <!-- Enter description of the fix in this section --> Fix two Windows compilation errors introduced by #39917 in `GesturePlatformManager.Windows.cs`: - `OnTap` receives `RoutedEventArgs`, which has no `Handled` property (`CS1061`). Use the existing `SetHandled(true)` extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types. - The visual-tree traversal's unqualified `ItemsView` binds to the MAUI control, not the native WinUI control (`CS8121`). Explicitly name `Microsoft.UI.Xaml.Controls.ItemsView`. The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration. **Validation** The unchanged candidate reproduces both compiler errors in native build [1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504) and both UI sample builds in [1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501), including their in-job retries. The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was validated by the existing full `maui-pr` pipeline [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565). Both completed Windows build jobs report **Build succeeded / 0 errors**, and their raw logs contain the Controls outputs for **both** `net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`. Exact CI commands, both passed: ```text D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true ``` These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: [Debug 139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1), [Release 209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1). Local file-specific formatting check passed: ```text .dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet ``` **Not an all-green CI claim:** the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged `ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks call `TaskCompletionSource.SetResult` twice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair. Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open #38822 does not modify this source file. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the Windows compilation regression introduced by #39917; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 23, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate #40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in #40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to #40116. Fixes the test-host crash found while validating #40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
KarthikRajaKalaimani
pushed a commit
to KarthikRajaKalaimani/maui
that referenced
this pull request
Nov 26, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated repair of candidate dotnet#40116, targeting `candidate/11.0.1xx-sr2`. ### Description of Change <!-- Enter description of the fix in this section --> Fix two Windows compilation errors introduced by dotnet#39917 in `GesturePlatformManager.Windows.cs`: - `OnTap` receives `RoutedEventArgs`, which has no `Handled` property (`CS1061`). Use the existing `SetHandled(true)` extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types. - The visual-tree traversal's unqualified `ItemsView` binds to the MAUI control, not the native WinUI control (`CS8121`). Explicitly name `Microsoft.UI.Xaml.Controls.ItemsView`. The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration. **Validation** The unchanged candidate reproduces both compiler errors in native build [1685504](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685504) and both UI sample builds in [1685501](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685501), including their in-job retries. The exact two-line commit `64e0571f440e392fab4b69178492163c468bba6c` was validated by the existing full `maui-pr` pipeline [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565). Both completed Windows build jobs report **Build succeeded / 0 errors**, and their raw logs contain the Controls outputs for **both** `net11.0-windows10.0.19041.0` and `net11.0-windows10.0.20348.0`. Exact CI commands, both passed: ```text D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Debug /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Debug/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true D:\a\_work\1\s\build.cmd -ci -restore -build -configuration Release /p:ArchiveTests=false /p:TreatWarningsAsErrors=false /p:SkipInitInternalTooling=true /bl:D:\a\_work\1\s/artifacts/log/Release/build_Windows.binlog /p:OfficialBuildId=20261117.89 /p:_SkipUpdateBuildNumber=true ``` These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: [Debug 139](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/139?api-version=7.1), [Release 209](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1685565/logs/209?api-version=7.1). Local file-specific formatting check passed: ```text .dotnet/dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet ``` **Not an all-green CI claim:** the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged `ViewUnitTests.StartTimerSimple`, where overlapping stub timer callbacks call `TaskCompletionSource.SetResult` twice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair. Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open dotnet#38822 does not modify this source file. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to dotnet#40116. Fixes the Windows compilation regression introduced by dotnet#39917; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
KarthikRajaKalaimani
pushed a commit
to KarthikRajaKalaimani/maui
that referenced
this pull request
Nov 26, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. This is the explicitly coordinated candidate dotnet#40116 test-infrastructure repair, targeting `candidate/11.0.1xx-sr2`. It is independent of the Windows compilation correction in dotnet#40335. ### Description of Change <!-- Enter description of the fix in this section --> The Windows Release Controls.Core unit-test host in [1685565](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685565) aborted before writing its XML results: ```text InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. TaskCompletionSource<bool>.SetResult ViewUnitTests.StartTimerSimple:505 DispatcherExtensions.StartTimer.OnTick:120 DispatcherTimerStub.OnTimeout:83 ``` `DispatcherTimerStub` uses a periodic `System.Threading.Timer`. The default test dispatcher invokes callbacks inline on ThreadPool threads, so multiple ticks can run concurrently. `StartTimer` removes its handler and stops only after the callback returns `false`; a synchronous continuation inside the first `SetResult` can leave time for another tick to invoke the callback again. Serialize the **dispatched** tick callbacks with a per-timer lock and check that the timer is still running before invoking a queued tick. Use the same lock when starting or stopping. This models a dispatcher's sequential callback execution and prevents an already-queued tick from running after the first callback stops the timer. Add `CreateTimerQueuedCallbacksDoNotOverlapOrRunAfterStop` to the existing Core dispatcher tests. It captures two actual queued timer callbacks, starts them on separate threads, holds the first callback, and verifies that the second neither overlaps it nor fires after `Stop`. Both worker tasks are joined in cleanup. No shipping dispatcher code changes. `ViewUnitTests.StartTimerSimple` and `StartTimerMultiple`, including their `SetResult`, assertions and intervals, are unchanged. No exception suppression, `TrySetResult`, skip, retry-budget, timeout, dependency-version, or pipeline change. **Validation** Using the repository-pinned .NET SDK `11.0.101-servicing.26559.106`: - The prescribed verifier reports **`VERIFICATION PASSED`**: the dispatcher class is **9 passed / 1 failed without the stub fix**, with the new test failing `Assert.False` on an overlapping tick; **10 passed / 0 failed with it**. The script restored the committed worktree itself. - Full Release Core suite: **1,126 passed**. Full Release Controls.Core suite: **6,816 passed, 30 existing skips**. Original method/outcome multiplicities match the retained candidate results, with only the new Core regression case added. Both original timer tests pass unchanged. - Full Debug Core suite: **1,126 passed**. The separate full Debug Controls invocation was blocked before tests by an unavailable `GeneratePublicApiFiles` task in its Maps dependency; it is **not** claimed as a pass. No analyzer was disabled. - An exact-source managed diagnostic that previously reproduced the CI-shaped duplicate `SetResult` crash also passes with the actual fixed stub. This is controlled interleaving evidence, not a claim that the original CI scheduler was instrumented. - After pushing the exact commit, these commands passed again: ```bash dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter FullyQualifiedName~DispatcherTests -v:quiet # Passed: 10, Failed: 0 dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -c Release -f net11.0 --no-build --no-restore --filter 'FullyQualifiedName~StartTimerSimple|FullyQualifiedName~StartTimerMultiple' -v:quiet # Passed: 2, Failed: 0 ``` The verifier command was: ```powershell $PSDefaultParameterValues["EstablishBrokenBaseline.ps1:BaseBranch"] = "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" & ./.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -TestType UnitTest -FixFiles @("src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs") -BaseBranch "5cfa4f4cbb3d1f099a26f0db8a3f511437077d2b" -PRNumber "timer-local-autodetect" -RequireFullVerification ``` The command-local PowerShell default preserves the same explicit frozen SHA through the existing dot-sourced helper; no verification script was edited. An earlier explicit-filter invocation was blocked because the runner did not resolve its unit project; it restored the worktree and is not counted as behavioral verification. Local test runs used `DOTNET_MODIFIABLE_ASSEMBLIES=debug`, `LANG=en_US.UTF-8`, and `LC_ALL=en_US.UTF-8`. Build invocations selected only plain .NET targets through the existing `Include*TargetFrameworks=false` command-line properties. File-specific formatting and `git diff --check` passed. The original crashed CI scope has no result XML; its 6,846 cases remain unmeasured in that run. Local results do not retroactively mark it, other platforms, or the whole candidate green. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Relates to dotnet#40116. Fixes the test-host crash found while validating dotnet#40335; no separate issue was filed. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch was previously deployed
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Target Branch
mainnet11, for reviewFor .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into
net11; agents must not retarget or merge.This is the explicitly coordinated repair of candidate #40116, targeting
candidate/11.0.1xx-sr2.Description of Change
Fix two Windows compilation errors introduced by #39917 in
GesturePlatformManager.Windows.cs:OnTapreceivesRoutedEventArgs, which has noHandledproperty (CS1061). Use the existingSetHandled(true)extension, as the same method already does for other handled gestures. It dispatches to the right-, single-, and double-tap event argument types.ItemsViewbinds to the MAUI control, not the native WinUI control (CS8121). Explicitly nameMicrosoft.UI.Xaml.Controls.ItemsView.The diff is one file and two lines. It preserves the CollectionView bubbling logic and changes no tests, assertions, skips, tolerances, deadlines, SDK/package versions, or pipeline configuration.
Validation
The unchanged candidate reproduces both compiler errors in native build 1685504 and both UI sample builds in 1685501, including their in-job retries.
The exact two-line commit
64e0571f440e392fab4b69178492163c468bba6cwas validated by the existing fullmaui-prpipeline 1685565. Both completed Windows build jobs report Build succeeded / 0 errors, and their raw logs contain the Controls outputs for bothnet11.0-windows10.0.19041.0andnet11.0-windows10.0.20348.0.Exact CI commands, both passed:
These are the pipeline's existing commands and warning policy, not changed by this PR. Raw build logs: Debug 139, Release 209.
Local file-specific formatting check passed:
Not an all-green CI claim: the same validation run separately aborts its Windows Release Controls.Core unit-test host in unchanged
ViewUnitTests.StartTimerSimple, where overlapping stub timer callbacks callTaskCompletionSource.SetResulttwice. That scope writes no result XML. The timer sources are identical on the candidate and this branch; no timer workaround is included here. Runtime/UI gesture behavior was not newly exercised by this compilation repair.Upstream open/recently merged exact-mechanism searches found no competing correction. The broad open #38822 does not modify this source file.
Issues Fixed
Relates to #40116. Fixes the Windows compilation regression introduced by #39917; no separate issue was filed.