Repository navigation
fix(hr): report a compiler crash during the delta emit as a rude edit (backport #25420) - #25495
Merged
Merged
Conversation
When Roslyn throws while emitting a Hot Reload delta (e.g. dotnet/roslyn#86045), the pass fell into the manager's catch-all and completed as InternalError. The EnC baseline does not move, so every later edit failed the same way until the app restarted, with nothing telling the user that undoing the edit recovers. Exceptions thrown by EmitSolutionUpdateAsync (cancellation excepted) now complete the operation as RudeEdit with a synthesized UNOHR0001 diagnostic asking the user to undo the change or restart the app. The full exception is still logged at Warn level. Exceptions anywhere else in the pass stay InternalError. Fixes #25418 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WjQPjTHecnxjgcqBhM8z3e (cherry picked from commit 2f6759a)
Adds a Hot Reload Errors section to the error codes page: what the diagnostic means, that undoing the change or restarting the app recovers, and the known cause (dotnet/roslyn#86045). Adds UNOHR to the cSpell word list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WjQPjTHecnxjgcqBhM8z3e (cherry picked from commit a59b726)
The emit failure now uses Roslyn's ENC1002 ("Cannot apply changes --
unexpected error"), which Roslyn itself uses for an internal error
treated as a blocking rude edit, so no Uno-specific id is needed.
This reverts commit a59b726.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WjQPjTHecnxjgcqBhM8z3e
(cherry picked from commit 2d90b5b)
Roslyn already has an id for this case: ENC1002 ("Cannot apply changes
-- unexpected error"), which EmitSolutionUpdateResults.CreateFromInternalError
uses for an internal error treated as a blocking rude edit. The
synthesized diagnostic now uses it, keeping the message that says how to
recover, and the rude-edit filter is back to accepting ENC ids only.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WjQPjTHecnxjgcqBhM8z3e
(cherry picked from commit 855e34d)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0113rBQqDXVtD6eMXC8Eygn7 (cherry picked from commit 805434b)
ENC ids belong to Roslyn. The synthesized diagnostic goes back to an Uno id, UNOHR0001, and the rude-edit filter accepts it alongside the ENC ids. This reverts commit 855e34d. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0113rBQqDXVtD6eMXC8Eygn7 (cherry picked from commit 12a7866)
Restores the Hot Reload Errors entry for UNOHR0001 and the UNOHR cSpell word. This reverts commit 2d90b5b. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0113rBQqDXVtD6eMXC8Eygn7 (cherry picked from commit d5d3473)
3 of 4 tasks
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25495/docs/index.html |
Contributor
|
|
ajpinedam
approved these changes
Oct 14, 2026
Closed
1 task done
2 tasks done
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25495/docs/index.html |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Member
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25495/docs/index.html |
agneszitte
approved these changes
Nov 3, 2026
ajpinedam
pushed a commit
to ajpinedam/uno
that referenced
this pull request
Nov 3, 2026
…ied (6.8, backport of unoplatform#24085) Backport of unoplatform#24085 to servicing/6.8, on top of the backport of unoplatform#25420 (unoplatform#25495), which it builds on. Applies cleanly. (cherry picked from commit 503b548) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
1 task done
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.
GitHub Issue: closes #25418
PR Type:
🐞 Bugfix
What changed? 🚀
When Roslyn throws while emitting a Hot Reload delta,
HotReloadManagercompleted the operation asInternalErrorthrough the pass's catch-all. The EnC baseline doesn't move, so every later edit hit the same crash and also reportedInternalErroruntil the app restarted. Nothing told the user that undoing the edit recovers. The current trigger is dotnet/roslyn#86045, which MVUX's generated code hits when a command's parameters change (MVUX workaround: unoplatform/uno.extensions#3227)._watchService.EmitSolutionUpdateAsynconly, except cancellation of the pass's token, now complete the pass asRudeEdit, with one synthesized diagnostic,UNOHR0001("Hot Reload update could not be emitted"). It is an Uno id becauseENCids belong to Roslyn. The message says how to recover:"The compiler could not produce a Hot Reload update for this change (). Undo the change to keep going, or restart the app."
CreateFromInternalErrorcalls, whereFatalError.ReportAndCatchUnlessCanceledlets anOperationCanceledExceptionthrough only when the passed token is cancelled:catch (Exception e) when (e is not OperationCanceledException || !ct.IsCancellationRequested). A cancellation exception thrown by the emit whilectis not cancelled is a compiler failure like any other.ENCids, so it takes the existing rude-edit path: reporter, operation diagnostics, handler.InternalError.Clients already treat
RudeEditas "this edit needs a restart", so IDEs and the App MCP react correctly without changes. The App MCP's wording for this case is in unoplatform/uno.app-mcp#203 and #204.Test:
Given_HotReloadManager.EmitFailureruns a realHotReloadManageroverEnCHarness(the real Roslyn EnC pipeline, no stubbed emitter), with the code shape from dotnet/roslyn#86045:RudeEdit, a singleUNOHR0001diagnostic, no deltas, and the Warn log.NoChanges.Successwith one delta.It fails with
InternalErrorbefore the fix.EnCHarness.CreateAsyncgained optional baseline-source and extra-reference parameters;dynamicneeds Microsoft.CSharp, System.Linq.Expressions and System.Runtime.Verified end to end: I swapped this
Uno.HotReload.dllinto a 7.0.0-dev.2270 DevServer host; no commits touchsrc/Uno.HotReloadbetween that build and this branch's base. I then ran the repro on a recommended-preset MVUX app on Skia desktop:Notes:
-p:NetCurrent=net10.0 -p:NetPrevious=net9.0), because the machine has no .NET 11 SDK. Roslyn is 5.6.0 for both TFMs.PR Checklist ✅
src/Uno.HotReload.Tests; that project: 148 passed, 1 skip that was already there)UNOHR0001indoc/articles/uno-build-error-codes.md, under a new Hot Reload Errors section;UNOHRadded to the cSpell word list)Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01WjQPjTHecnxjgcqBhM8z3e
This is an automatic backport of pull request #25420 done by [Mergify](https://mergify.com).