Repository navigation
fix(hotreload): do not fork the solution for an add that changed nothing (backport #24617) - #25774
Merged
agneszitte merged 3 commits intoOct 28, 2026
Merged
Conversation
A pass that mutates nothing must return the original solution instance, so the manager takes its NoChanges short-circuit before reaching the EnC emit. Two paths defeated that: the analyzer-config refresh rewrote every .editorconfig as soon as the change set *requested* an add or a remove — including an add the updater de-duplicates because the document is already in the project, which is what a re-observed file creation looks like — and the removes were applied even for an empty list. Both fork the snapshot, and a forked snapshot is emitted. The refresh now runs only when an add or a remove was actually applied, and compares content before rewriting, as the document texts already did. The cost is not a wasted roundtrip. An update Roslyn resolves to `status: None` corrupts the edit session's deleted-member bookkeeping, and the failure lands on the *next* real edit as a NullReferenceException in DefinitionMap.GetPreviousPropertyHandle (dotnet/roslyn#79898), leaving hot reload dead for the rest of the session. IRL_Case_002 records that sequence in the metadata-update scenarios: edit, empty generation, edit. (cherry picked from commit 8a21757)
The gate moved from what the change set requested to what the updater actually applied, and only the negative side was covered: a de-duplicated add must not fork the solution. Nothing pinned the positive side, so a regression leaving the flag false for a genuine add would silently stop refreshing analyzer configs — the behaviour the gate exists to preserve. Verified to bite: with the flag assignment removed from the add loop, the new test fails on the config text still reading "is_global = true" instead of the on-disk content. (cherry picked from commit 4dabbe1)
… test This repo is public; the field report it cited lives in a private tracker, and AGENTS.md forbids a public spec from carrying a private issue identifier as normative evidence. The observation that matters — the empty update sitting one second before the crashing emit — is kept, without the reference. The test plan also stopped at the de-duplicated add while the same branch added the genuine-add test, so the spec was undercounting its own coverage. (cherry picked from commit 6dc6199)
agneszitte
approved these changes
Oct 28, 2026
This was referenced Nov 9, 2026
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.
Closes #24616
Closes https://github.com/unoplatform/uno.hotdesign/issues/8040
SolutionUpdaternow tracks whether an add or a remove was applied, gates the analyzer-configrefresh on that, and compares config content before rewriting — the same content-level rule spec 055
R1 already applied to document texts.
Tests
Given_SolutionUpdater.When_AddedDocumentIsAlreadyInProject_Then_OriginalSolutionInstanceReturnedfails without the fix (the solution is forked) and passes with it.
IRL_Case_002records the field sequence inMetadataUpdateTests: edit, empty generation,edit ->
NullReferenceExceptioninDefinitionMap.GetPreviousPropertyHandle. MarkedIsCrashingRoslyn, like the existingWhen_Page_Res_xBind_Remove, so it reportsInconclusiveuntil HR fails when requesting an intermediate empty update dotnet/roslyn#79898 is fixed.Uno.HotReload.Tests: 147/147.Not addressed
The unrealized-text bypass of spec 055 R1 stays as-is: comparing an unrealized document would
re-read the file and could swallow a first edit. Closing it requires remembering what the current
compilation saw, which is a design change of its own.
This is an automatic backport of pull request #24617 done by Mergify.