Skip to content

[XIHR] Add regression test for default-template MainPage text edit (#40413) - #40417

Merged
kubaflo merged 1 commit into
candidate/11.0.1xx-sr2from
stephanedelcroix-fix-40413-xaml-hot-reload
Nov 19, 2026
Merged

kubaflo merged 1 commit into
candidate/11.0.1xx-sr2from
stephanedelcroix-fix-40413-xaml-hot-reload

Conversation

@StephaneDelcroix

Copy link
Copy Markdown
Contributor

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

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

Base is candidate/11.0.1xx-sr2, not net11. The PR is test-only and covers behavior that exists only on the candidate branch, from the #36937 fix chain #40233, #40235, #40329, #40330, and #40378. Against net11 the test fails, because that fix has not flowed there yet. This follows the precedent of #40329, #40330, and #40378, which targeted this branch for the same reason. Maintainers: retarget if you prefer a different lane.

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.

Description of Change

#40413 reports that in VS on Windows (.NET 11, SourceGen inflator, XAML Incremental Hot Reload on by default in Debug), editing a Label's Text in the default template's MainPage.xaml is not applied.

Root cause. This is #36937. Roslyn/VS evaluate the same edited generator-driver snapshot more than once, for example forked or speculative runs, or a throwaway compilation before the applied one. On net11, the first evaluation advances the cached previous XAML. The evaluation that is actually applied then sees no diff and emits an empty UpdateComponent, and the runtime silently skips it. The bug became visible in .NET 11 because XIHR is now the default; 10.0.120 used legacy XAML Hot Reload.

I reproduced this with the issue's own template MainPage.xaml through the source generator:

Sequence net11 (a25e629) candidate/11.0.1xx-sr2 (cec6650)
Edit evaluated once patch patch
Same edited snapshot evaluated twice: 2nd run empty UC patch
Throwaway compilation first, then real run: real run empty UC patch

On the candidate branch the existing fixes already handle this. This PR adds DefaultTemplateMainPageTextEdit_SurvivesRepeatedAndThrowawayEvaluations, a theory with repeated and throwaway-first cases. It uses the template page shape (StaticResource styles from a sibling Styles.xaml, x:Name, a Clicked handler in code-behind) to lock in the reported scenario. There are no product changes.

Android .NET 10 (validation comment). This is a separate scenario. XIHR was not the default in .NET 10, so that report involves the legacy XAML Hot Reload path and is not caused by this regression. It is not addressed here.

Validation

  • DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj --filter "FullyQualifiedName~XamlIncrementalHotReloadPipelineTests|FullyQualifiedName~CodeBehindFieldStabilityTests": passed, 93/93, on this branch.
  • net11: the same two sequences, run through an equivalent temporary probe with the template XAML, produce an empty UC, as shown in the table. I did not port the committed test itself to net11: its helpers exist only on candidate, and reverting the fix commits in place conflicts.
  • Not verified in Visual Studio on Windows or on device; I worked on a macOS host.

Issues Fixed

Fixes #40413

…40413)

Covers the default MAUI template MainPage (StaticResource styles from a
sibling Styles.xaml, x:Name and event handler in code-behind): editing the
Label text must still produce the UpdateComponent patch when the IDE
evaluates the edited snapshot again or runs a throwaway compilation first.
On net11 the later evaluation emits an empty UpdateComponent and the edit
is dropped (#36937); the candidate/11.0.1xx-sr2 fixes (#40233, #40330,
#40378) keep the patch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
@MauiBot

MauiBot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@StephaneDelcroix — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Android


🧪 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.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 0 findings

Reviewed commit 5c2ddbf.

@kubaflo
kubaflo merged commit 12c6c51 into candidate/11.0.1xx-sr2 Nov 19, 2026
43 of 46 checks passed
@kubaflo
kubaflo deleted the stephanedelcroix-fix-40413-xaml-hot-reload branch November 19, 2026 10:59
@kubaflo kubaflo mentioned this pull request Nov 19, 2026
1 task
kubaflo pushed a commit that referenced this pull request Nov 19, 2026
…40413) (#40417)

<!-- 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).

**Base is `candidate/11.0.1xx-sr2`, not `net11`.** The PR is test-only
and covers behavior that exists only on the candidate branch, from the
#36937 fix chain #40233, #40235, #40329, #40330, and #40378. Against
`net11` the test fails, because that fix has not flowed there yet. This
follows the precedent of #40329, #40330, and #40378, which targeted this
branch for the same reason. Maintainers: retarget if you prefer a
different lane.

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.

### Description of Change

#40413 reports that in VS on Windows (.NET 11, SourceGen inflator, XAML
Incremental Hot Reload on by default in Debug), editing a Label's `Text`
in the default template's `MainPage.xaml` is not applied.

**Root cause.** This is #36937. Roslyn/VS evaluate the same edited
generator-driver snapshot more than once, for example forked or
speculative runs, or a throwaway compilation before the applied one. On
`net11`, the first evaluation advances the cached previous XAML. The
evaluation that is actually applied then sees no diff and emits an empty
`UpdateComponent`, and the runtime silently skips it. The bug became
visible in .NET 11 because XIHR is now the default; 10.0.120 used legacy
XAML Hot Reload.

I reproduced this with the issue's own template `MainPage.xaml` through
the source generator:

| Sequence | `net11` (a25e629) | `candidate/11.0.1xx-sr2`
(cec6650) |
| --- | --- | --- |
| Edit evaluated once | patch | patch |
| Same edited snapshot evaluated twice: 2nd run | **empty UC** | patch |
| Throwaway compilation first, then real run: real run | **empty UC** |
patch |

On the candidate branch the existing fixes already handle this. This PR
adds
`DefaultTemplateMainPageTextEdit_SurvivesRepeatedAndThrowawayEvaluations`,
a theory with repeated and throwaway-first cases. It uses the template
page shape (`StaticResource` styles from a sibling `Styles.xaml`,
`x:Name`, a `Clicked` handler in code-behind) to lock in the reported
scenario. There are no product changes.

**Android .NET 10 (validation comment).** This is a separate scenario.
XIHR was not the default in .NET 10, so that report involves the legacy
XAML Hot Reload path and is not caused by this regression. It is not
addressed here.

**Validation**
- `DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test
src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj
--filter
"FullyQualifiedName~XamlIncrementalHotReloadPipelineTests|FullyQualifiedName~CodeBehindFieldStabilityTests"`:
**passed**, 93/93, on this branch.
- `net11`: the same two sequences, run through an equivalent temporary
probe with the template XAML, produce an empty UC, as shown in the
table. I did not port the committed test itself to `net11`: its helpers
exist only on candidate, and reverting the fix commits in place
conflicts.
- Not verified in Visual Studio on Windows or on device; I worked on a
macOS host.

### Issues Fixed

Fixes #40413

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo pushed a commit that referenced this pull request Nov 22, 2026
…40413) (#40417)

<!-- 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).

**Base is `candidate/11.0.1xx-sr2`, not `net11`.** The PR is test-only
and covers behavior that exists only on the candidate branch, from the
#36937 fix chain #40233, #40235, #40329, #40330, and #40378. Against
`net11` the test fails, because that fix has not flowed there yet. This
follows the precedent of #40329, #40330, and #40378, which targeted this
branch for the same reason. Maintainers: retarget if you prefer a
different lane.

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.

### Description of Change

#40413 reports that in VS on Windows (.NET 11, SourceGen inflator, XAML
Incremental Hot Reload on by default in Debug), editing a Label's `Text`
in the default template's `MainPage.xaml` is not applied.

**Root cause.** This is #36937. Roslyn/VS evaluate the same edited
generator-driver snapshot more than once, for example forked or
speculative runs, or a throwaway compilation before the applied one. On
`net11`, the first evaluation advances the cached previous XAML. The
evaluation that is actually applied then sees no diff and emits an empty
`UpdateComponent`, and the runtime silently skips it. The bug became
visible in .NET 11 because XIHR is now the default; 10.0.120 used legacy
XAML Hot Reload.

I reproduced this with the issue's own template `MainPage.xaml` through
the source generator:

| Sequence | `net11` (a25e629) | `candidate/11.0.1xx-sr2`
(cec6650) |
| --- | --- | --- |
| Edit evaluated once | patch | patch |
| Same edited snapshot evaluated twice: 2nd run | **empty UC** | patch |
| Throwaway compilation first, then real run: real run | **empty UC** |
patch |

On the candidate branch the existing fixes already handle this. This PR
adds
`DefaultTemplateMainPageTextEdit_SurvivesRepeatedAndThrowawayEvaluations`,
a theory with repeated and throwaway-first cases. It uses the template
page shape (`StaticResource` styles from a sibling `Styles.xaml`,
`x:Name`, a `Clicked` handler in code-behind) to lock in the reported
scenario. There are no product changes.

**Android .NET 10 (validation comment).** This is a separate scenario.
XIHR was not the default in .NET 10, so that report involves the legacy
XAML Hot Reload path and is not caused by this regression. It is not
addressed here.

**Validation**
- `DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test
src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj
--filter
"FullyQualifiedName~XamlIncrementalHotReloadPipelineTests|FullyQualifiedName~CodeBehindFieldStabilityTests"`:
**passed**, 93/93, on this branch.
- `net11`: the same two sequences, run through an equivalent temporary
probe with the template XAML, produce an empty UC, as shown in the
table. I did not port the committed test itself to `net11`: its helpers
exist only on candidate, and reverting the fix commits in place
conflicts.
- Not verified in Visual Studio on Windows or on device; I worked on a
macOS host.

### Issues Fixed

Fixes #40413

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo pushed a commit that referenced this pull request Nov 23, 2026
…40413) (#40417)

<!-- 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).

**Base is `candidate/11.0.1xx-sr2`, not `net11`.** The PR is test-only
and covers behavior that exists only on the candidate branch, from the
#36937 fix chain #40233, #40235, #40329, #40330, and #40378. Against
`net11` the test fails, because that fix has not flowed there yet. This
follows the precedent of #40329, #40330, and #40378, which targeted this
branch for the same reason. Maintainers: retarget if you prefer a
different lane.

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.

### Description of Change

#40413 reports that in VS on Windows (.NET 11, SourceGen inflator, XAML
Incremental Hot Reload on by default in Debug), editing a Label's `Text`
in the default template's `MainPage.xaml` is not applied.

**Root cause.** This is #36937. Roslyn/VS evaluate the same edited
generator-driver snapshot more than once, for example forked or
speculative runs, or a throwaway compilation before the applied one. On
`net11`, the first evaluation advances the cached previous XAML. The
evaluation that is actually applied then sees no diff and emits an empty
`UpdateComponent`, and the runtime silently skips it. The bug became
visible in .NET 11 because XIHR is now the default; 10.0.120 used legacy
XAML Hot Reload.

I reproduced this with the issue's own template `MainPage.xaml` through
the source generator:

| Sequence | `net11` (a25e629) | `candidate/11.0.1xx-sr2`
(cec6650) |
| --- | --- | --- |
| Edit evaluated once | patch | patch |
| Same edited snapshot evaluated twice: 2nd run | **empty UC** | patch |
| Throwaway compilation first, then real run: real run | **empty UC** |
patch |

On the candidate branch the existing fixes already handle this. This PR
adds
`DefaultTemplateMainPageTextEdit_SurvivesRepeatedAndThrowawayEvaluations`,
a theory with repeated and throwaway-first cases. It uses the template
page shape (`StaticResource` styles from a sibling `Styles.xaml`,
`x:Name`, a `Clicked` handler in code-behind) to lock in the reported
scenario. There are no product changes.

**Android .NET 10 (validation comment).** This is a separate scenario.
XIHR was not the default in .NET 10, so that report involves the legacy
XAML Hot Reload path and is not caused by this regression. It is not
addressed here.

**Validation**
- `DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test
src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj
--filter
"FullyQualifiedName~XamlIncrementalHotReloadPipelineTests|FullyQualifiedName~CodeBehindFieldStabilityTests"`:
**passed**, 93/93, on this branch.
- `net11`: the same two sequences, run through an equivalent temporary
probe with the template XAML, produce an empty UC, as shown in the
table. I did not port the committed test itself to `net11`: its helpers
exist only on candidate, and reverting the fix commits in place
conflicts.
- Not verified in Visual Studio on Windows or on device; I worked on a
macOS host.

### Issues Fixed

Fixes #40413

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo kubaflo added this to the .NET 11 SR2 milestone Nov 24, 2026
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
…otnet#40413) (dotnet#40417)

<!-- 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).

**Base is `candidate/11.0.1xx-sr2`, not `net11`.** The PR is test-only
and covers behavior that exists only on the candidate branch, from the
dotnet#36937 fix chain dotnet#40233, dotnet#40235, dotnet#40329, dotnet#40330, and dotnet#40378. Against
`net11` the test fails, because that fix has not flowed there yet. This
follows the precedent of dotnet#40329, dotnet#40330, and dotnet#40378, which targeted this
branch for the same reason. Maintainers: retarget if you prefer a
different lane.

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.

### Description of Change

dotnet#40413 reports that in VS on Windows (.NET 11, SourceGen inflator, XAML
Incremental Hot Reload on by default in Debug), editing a Label's `Text`
in the default template's `MainPage.xaml` is not applied.

**Root cause.** This is dotnet#36937. Roslyn/VS evaluate the same edited
generator-driver snapshot more than once, for example forked or
speculative runs, or a throwaway compilation before the applied one. On
`net11`, the first evaluation advances the cached previous XAML. The
evaluation that is actually applied then sees no diff and emits an empty
`UpdateComponent`, and the runtime silently skips it. The bug became
visible in .NET 11 because XIHR is now the default; 10.0.120 used legacy
XAML Hot Reload.

I reproduced this with the issue's own template `MainPage.xaml` through
the source generator:

| Sequence | `net11` (a25e629) | `candidate/11.0.1xx-sr2`
(cec6650) |
| --- | --- | --- |
| Edit evaluated once | patch | patch |
| Same edited snapshot evaluated twice: 2nd run | **empty UC** | patch |
| Throwaway compilation first, then real run: real run | **empty UC** |
patch |

On the candidate branch the existing fixes already handle this. This PR
adds
`DefaultTemplateMainPageTextEdit_SurvivesRepeatedAndThrowawayEvaluations`,
a theory with repeated and throwaway-first cases. It uses the template
page shape (`StaticResource` styles from a sibling `Styles.xaml`,
`x:Name`, a `Clicked` handler in code-behind) to lock in the reported
scenario. There are no product changes.

**Android .NET 10 (validation comment).** This is a separate scenario.
XIHR was not the default in .NET 10, so that report involves the legacy
XAML Hot Reload path and is not caused by this regression. It is not
addressed here.

**Validation**
- `DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test
src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj
--filter
"FullyQualifiedName~XamlIncrementalHotReloadPipelineTests|FullyQualifiedName~CodeBehindFieldStabilityTests"`:
**passed**, 93/93, on this branch.
- `net11`: the same two sequences, run through an equivalent temporary
probe with the template XAML, produce an empty UC, as shown in the
table. I did not port the committed test itself to `net11`: its helpers
exist only on candidate, and reverting the fix commits in place
conflicts.
- Not verified in Visual Studio on Windows or on device; I worked on a
macOS host.

### Issues Fixed

Fixes dotnet#40413

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 5c2ddbf9 Deployed Nov 19, 2026 by StephaneDelcroix via conclusion #3115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants