Repository navigation
Description
Summary
Two related problems on the iOS simulator (iOS 26.1, .NET for iOS on Mono with the interpreter, Debug):
- MVUX model edits made through hot reload don't apply. The same 5
Reactive.WinUI.Tests.Given_HotReloadtests fail as on Android before fix(reactive): enable MVUX hot reload on Android #3235. The plain method-body edit passes, so the runtime does apply deltas; only the MVUX model swap is missing. - With fix(reactive): enable MVUX hot reload on Android #3235 applied, the test app hangs before any test runs. In 2 of 2 runs it never completes the DevServer handshake. Without fix(reactive): enable MVUX hot reload on Android #3235 it completes in 3 of 3 runs.
#3235 only changes behavior when Assembly.GetEntryAssembly() is null. That it changes anything on iOS suggests the entry assembly is null on the iOS simulator, contrary to the earlier assumption that iOS has one because the head has a managed Main. Nothing has confirmed that directly yet; the app had no logging (see "Diagnostics gap").
#3235 is on hold until this is understood. Narrowing it to Android is an option.
Background
- [HR][Android] C# edits to an MVUX model are reported applied, but the app keeps running the old code uno#25417: on Android, MVUX hot reload was fully disabled.
ModuleFeedConfiguration.ConfigureHotReloadonly applies the setting from the module whose name matchesAssembly.GetEntryAssembly(), and that is null on Android, soFeedConfiguration.EffectiveHotReloadstaysDisabled.BindableViewModelBase.HotPatchthen returns early with only an Info log ("Hot reload has been disabled."). - fix(reactive): enable MVUX hot reload on Android #3235 (branch
dev/sb/mvux-hr-android-entry-assembly, commit15065079c): when there is no entry assembly, the first module to callConfigureHotReloadis taken as the app, viaInterlocked.Exchange. It also logs a Warning when an MVUX update arrives while hot reload is disabled. - ci: run hot-reload runtime tests on Android and iOS #3238 (branch
dev/sb/mobile-hr-lanes): adds the mobile hot-reload CI lanes that found this.
Evidence
The affected tests, in src/Uno.Extensions.Reactive.UI.Tests/Given_HotReload.cs:
When_UpdateMvuxFeedSource_Then_NewViewModelReflectsUpdateWhen_NewVMWithCtorDepsConstructedAfterHR_Then_ReflectsUpdateWhen_UpdateInheritedParentModel_Then_ChildBindingsRefreshWhen_AddDerivedFeedToModelWithStateAndCommand_Then_CommandUpdatesBoundStateWhen_UpdateStateValue_Then_NewViewModelReflectsUpdate
Each fails with System.TimeoutException: Operation has been cancelled after 0:00:05 in TestHelper.WaitFor: the bound value never changes to the edited one.
| CI build | Branch | #3235 | iOS result |
|---|---|---|---|
| 239608 (3 attempts) | #3238 | no | completes; the 5 tests fail, the method-body test passes |
| 239627 (attempt 1) | #3238, per-class launches | no | completes; 36 pass (the 5 excluded) |
| 239648 | #3238 | no | green, 36/36 (the 5 excluded) |
| 239619 | draft #3239 = #3238 + #3235 | yes | hangs: no result file in 1800s |
| 239628 | draft #3239, per-class launches | yes | hangs: the first launch (Reactive class) never writes results |
Shape of the hang (both runs):
- The app opens its two DevServer WebSocket connections, to
127.0.0.1:47100and[::1]:47100; the client races both. - No
ConfigureServerframe and no "App Connected" ever reach the DevServer, and the connections close after 12–60s. - No test sends a file edit.
- The process stays alive: os_log shows Metal shader compiles up to 25 minutes in.
For comparison, every run without #3235: "App Connected" and ConfigureServer arrive within seconds, followed by dozens of UpdateFileRequest frames.
The same 5 tests on Android: 9/14 on main, 14/14 with #3235 locally, 0 MVUX failures with #3235 on CI (build 239619).
Reproducing on a Mac
The device script runs locally as-is.
- Branch: check out
dev/sb/mobile-hr-lanes(ci: run hot-reload runtime tests on Android and iOS #3238). To test the fix, add fix(reactive): enable MVUX hot reload on Android #3235 on top withgit cherry-pick 15065079c. - Platform restriction: create
DebugPlatforms.propsat the repo root (git-ignored). The DevServer's own MSBuild workspace never sees-p:switches, so these must live in a file:<Project> <PropertyGroup> <Build_Android>false</Build_Android> <Build_iOS>true</Build_iOS> <Build_MacCatalyst>false</Build_MacCatalyst> <Build_Windows>false</Build_Windows> <Build_Web>false</Build_Web> <Build_Desktop>false</Build_Desktop> <UnoDisableHotDesign>true</UnoDisableHotDesign> <UnoDisableMCPSupport>true</UnoDisableMCPSupport> <UnoRemoteControlHost>127.0.0.1</UnoRemoteControlHost> <UnoRemoteControlPort>47100</UnoRemoteControlPort> </PropertyGroup> </Project>
- Build (Debug, simulator, no provisioning profile):
Xcode must match the iOS workload: CI pins
dotnet build src/Uno.Extensions.RuntimeTests/Uno.Extensions.RuntimeTests/Uno.Extensions.RuntimeTests.csproj \ -c Debug -f net10.0-ios -p:CodesignRequireProvisioningProfile=false
/Applications/Xcode_26.1.1.app(IosXCodeRootinbuild/ci/.azure-pipelines.yml). - Run the lane script, which boots the simulator, installs the app, starts the DevServer and launches once per filter:
Adjust
export DEV_SERVER_HOST_DLL="$(dotnet msbuild src/Uno.Extensions.RuntimeTests/Uno.Extensions.RuntimeTests/Uno.Extensions.RuntimeTests.csproj \ -nologo -t:GetRemoteControlHostPath -p:TargetFramework=net10.0-ios \ | sed -n 's:.*<RemoteControlHostPath>\(.*\)</RemoteControlHostPath>.*:\1:p' | head -n 1)" BUILD_SOURCESDIRECTORY="$PWD" \ RuntimeTestsArtifactPath="$PWD/src/Uno.Extensions.RuntimeTests/Uno.Extensions.RuntimeTests/bin" \ SIMULATOR_DEVICE="iPhone 16" SIMULATOR_RUNTIME_PREFIX="com.apple.CoreSimulator.SimRuntime.iOS-26-1" \ DEV_SERVER_PORT=47100 RUN_TIMEOUT_SECONDS=1200 \ TEST_FILTERS="Reactive.WinUI.Tests.Given_HotReload" \ bash build/test-scripts/ios-simulator-runtime-tests.sh
SIMULATOR_DEVICEandSIMULATOR_RUNTIME_PREFIXto whatxcrun simctl list devices availableshows.
Outputs: build/ios-runtime-tests/, containing:
- the merged
ios-runtime-tests-results.xmland onepart-N.xmlper launch logs/devserver.loglogs/app-log.txt(os_log, last 30 min)
build/test-scripts/validate-runtime-test-results.py prints the failing tests.
Diagnostics gap
App.InitializeLogging() is only called from Platforms/Desktop/Program.cs. On iOS (and Android) the app has no logger, so none of the MVUX messages appear anywhere. For diagnosis, call it from Platforms/iOS/Main.iOS.cs before building the host. On iOS it routes to OSLogLoggerProvider. Then add filters so the relevant categories reach Information:
Uno.Extensions.Reactive(orUno.Extensions.Reactive.Configand.Presentation.Bindings)Uno.UI.RemoteControl, already Trace inInitializeLogging
The messages to look for:
Module '<name>' has enabled hot-reload support for MVUX., or... but it is not the application module, request has been ignored.(ModuleFeedConfiguration.ConfigureHotReload).Hot reload has been disabled.(BindableViewModelBase.HotPatch, Info). With fix(reactive): enable MVUX hot reload on Android #3235 this becomes a Warning naming the model.
The simplest direct check is a Console.WriteLine of Assembly.GetEntryAssembly()?.GetName().Name and FeedConfiguration.EffectiveHotReload (internal; use reflection or InternalsVisibleTo). Put it in MobileRuntimeTestsAutostart.StartIfRequested, whose output is already captured in os_log.
For the hang:
- While the app is stuck, run
sample <pid> 10(the simulator process is a host process) orlldb -p <pid>thenbt all, to see what the main thread and the RemoteControl thread are doing. - Check whether the handshake (
ConfigureServer/AppLaunchMessage) waits on something that MVUX hot-reload initialization now blocks.
Code involved
| Path | Role |
|---|---|
src/Uno.Extensions.Reactive/Config/ModuleFeedConfiguration.cs |
Entry-assembly check; #3235 changes it |
src/Uno.Extensions.Reactive.Generator/HotReloadModuleInitializerGenerator.cs |
Emits a [ModuleInitializer] in every assembly that references Reactive, calling ConfigureHotReload("<assembly>", isEnabled). Note: test and library assemblies call it too, not just the head. |
src/Uno.Extensions.Reactive/Config/FeedConfiguration.cs |
EffectiveHotReload |
src/Uno.Extensions.Reactive/Presentation/Bindings/BindableViewModelBase.HotReload.cs |
HotPatch, the early return when disabled |
src/Uno.Extensions.Reactive/Core/HotReload/HotReloadService.cs |
MetadataUpdateHandler; dispatches HotPatch and TryHotPatch |
src/Uno.Extensions.Core/PlatformHelper.cs (~line 114) |
Documents GetEntryAssembly() as null on Android only |
src/Uno.Extensions.RuntimeTests/Uno.Extensions.RuntimeTests/Platforms/iOS/Main.iOS.cs |
The iOS Main |
src/Uno.Extensions.RuntimeTests/Uno.Extensions.RuntimeTests/MobileRuntimeTestsAutostart.cs |
In-app runner. UITEST_RUNTIME_IS_SECONDARY_APP runs [RunsInSecondaryApp] classes in-process and waits for the DevServer workspace first. |
Hypotheses to check
GetEntryAssembly()is null on the iOS simulator. This would explain the 5 failures (same root cause as [HR][Android] C# edits to an MVUX model are reported applied, but the app keeps running the old code uno#25417) and why fix(reactive): enable MVUX hot reload on Android #3235 changes iOS behavior at all.- With fix(reactive): enable MVUX hot reload on Android #3235 on iOS, the "first module" isn't the app. Module initializers run lazily, when a module is first touched. On iOS a library (
Uno.Extensions.Reactive.UI,Reactive.WinUI.Tests, ...) may configure first. That alone shouldn't hang, since every Debug module passesisEnabled: true, but confirm which module wins. - Enabling MVUX hot reload starts something during app startup that blocks the DevServer client's handshake. The deadlock would sit between the MVUX hot-reload setup and
RemoteControlClient, possibly on the UI thread. Example: a hot-reload handler orTryHotPatchrunning during startup.
Done when
- The root cause of both the 5 failures and the hang is identified, with logs or stacks attached here.
- MVUX hot reload works on iOS, and fix(reactive): enable MVUX hot reload on Android #3235 (or a follow-up) is correct on both platforms without hanging.
- The 5 tests are removed from the exclusions in
build/ci/stage-runtime-tests-mobile-hotreload.yml:- iOS:
IosTestFilters, under this issue. - Android:
AndroidTestFilters, excluded under fix(reactive): enable MVUX hot reload on Android #3235 so that ci: run hot-reload runtime tests on Android and iOS #3238 could merge; fix(reactive): enable MVUX hot reload on Android #3235 should remove them.
- iOS:
- The iOS hot-reload lane is green with them included.
- Consider keeping the
InitializeLogging()call on mobile, so the next CI failure leaves logs.
Related
- Mobile lanes: ci: run hot-reload runtime tests on Android and iOS #3238
- Android fix: fix(reactive): enable MVUX hot reload on Android #3235
- Other mobile hot-reload issues: Hot reload on Android: TabBar tab visited for the first time after a C# edit never loads #3237, Hot reload on Android (API 34): XAML edited while a page is unmaterialized isn't shown on reveal #3241, HR runtime test When_RemoveAndReAddMultipleProperties: UI never loads on the iOS simulator #3242, Hot reload on Android: Mono BadImageFormatException after ~100 deltas in one process #3243, HR runtime tests: a failed revert leaves the source file edited #3244, Hot reload on iOS: Region.Name changed via XAML HR intermittently isn't picked up by navigation #3245
- AGENTS.md: the "Hot-reload tests → Mobile lanes" note
Activity
[-]Hot reload on iOS: MVUX model updates don't apply (same 5 tests as #25417 on Android)[/-][+]Hot reload on iOS: MVUX model updates don't apply (same 5 tests as unoplatform/uno#25417 on Android)[/+]ci: isolate mobile hot-reload tests per class
ci: experiment - run the #3240 MVUX tests on iOS
kazo0 commentedon Oct 15, 2026
Update: with #3235, the iOS app hangs (2 of 2 runs); without it, it completes (3 of 3).
In both hung runs, the app opens its DevServer connections (127.0.0.1 and ::1), but no
ConfigureServeror "App Connected" ever arrives, and the connections close after 12–60s. No test sends an edit. The app keeps rendering, so the process is alive.Interpretation (unverified): #3235 only changes behavior when
Assembly.GetEntryAssembly()is null. That it changes iOS at all suggests the entry assembly is null on the iOS simulator. If so, MVUX hot reload is disabled on iOS for the same reason as Android (the 5 failures), and enabling it there then hangs something early, before the DevServer handshake.Next step: a local simulator run that logs
GetEntryAssembly(),FeedConfiguration.EffectiveHotReload, and where the app is stuck (a thread dump while it hangs).[-]Hot reload on iOS: MVUX model updates don't apply (same 5 tests as unoplatform/uno#25417 on Android)[/-][+]Hot reload on iOS: MVUX model updates don't apply, and #3235 hangs the app (needs Mac investigation)[/+]kazo0 commentedon Oct 15, 2026
Update: #3235 is now merged into
main(e059b8d). Somainitself carries the change that hung the iOS test app in draft #3239: don't cherry-pick15065079c, just usemainordev/sb/mobile-hr-lanes. #3238 has mergedmainand re-included the five tests on Android. Its iOS lane (MVUX tests still excluded) now shows whether the hang reproduces onmain; I'll post the result here.kazo0 commentedon Oct 15, 2026
New data point: with #3235 on
main, the iOS lane does not hang when the five MVUX tests are excluded.#3238 at
1abdea627(mainwith #3235 merged), build 239767:IosTestFilters.Compared with the two hung runs (draft #3239, builds 239619 and 239628): both had #3235 and the five MVUX tests in the first launch. Since the hang was observed before any
ConfigureServerreached the DevServer, the earlier reading was "startup hang, independent of tests". This run weakens that: the same #3235 code doesn't hang when those tests aren't in the filter. Either the hang is tied to running the MVUX hot-reload tests with MVUX hot reload enabled on iOS, or 2/2 was a coincidence.Suggested first experiment on the Mac: on
main, run the lane script withTEST_FILTERS="Reactive.WinUI.Tests.Given_HotReload"(the five included) and app logging enabled (see "Diagnostics gap"). Then run again with onlyWhen_UpdateMvuxFeedSource_Then_NewViewModelReflectsUpdate. If it hangs, take asample/lldb bt allwhile it's stuck.ci: re-include the MVUX hot-reload tests on iOS
kazo0 commentedon Oct 15, 2026
Local Mac results: the root cause of the 5 failures is confirmed. The hang doesn't reproduce locally.
The 5 MVUX failures:
GetEntryAssembly()is null during module initialization on iOSI added temporary
Console.WriteLines inModuleFeedConfiguration.ConfigureHotReload, in the iOSMainand inStartIfRequested(os_log, iOS simulator, Debug, with #3235):iOS does have an entry assembly, but Mono only sets it once
Mainstarts, after the app's[ModuleInitializer]has run.ModuleFeedConfiguration._entryAssemblyis captured when the type initializes, which happens inside that initializer, so it isnull. Without #3235 the app module never matches andEffectiveHotReloadstaysDisabled: same symptom as Android, different reason. With #3235 the app's own module calls first (beforeMain), wins, and hot reload isEnabled. Library and test modules call later and are correctly ignored.Hypothesis 1 is confirmed, with that refinement. Hypothesis 2 doesn't apply: the app module is always first. Note that the issue's logging recipe can't show
Module '<name>' has enabled..., because that message is logged from the module initializer, beforeMaincan callInitializeLogging().The hang: not reproduced locally
All runs used
build/test-scripts/ios-simulator-runtime-tests.shon an iOS 18.5 simulator (iPhone 16):dev/sb/mobile-hr-lanes(has #3235)Reactive.WinUI.Tests.Given_HotReloadIosTestFilterswith the 5 re-included6acbf9ca1(draft #3239, the commit that hung builds 239619/239628)IosTestFiltersThe draft #3239 base also predates
3443f8683(lane stabilization), but that commit doesn't touch the DevServer handshake, so it isn't an explanation. Since the exact hung commit completes locally, the hang is specific to the CI environment (iOS 26.1 on the hosted agent). Its cause is still unknown. #3251 re-includes the 5 tests on the iOS lane, so its CI run is the real test. It also turns on logging in the iOS and Android RuntimeTests heads, so a CI hang now leaves RemoteControl traces inapp-log.txt.The iOS 27 simulator can't be used for this: the app is killed at launch by UIKit's scene-lifecycle check (
_UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption), a known separate issue.ci: re-include the MVUX hot-reload tests on iOS
ci: re-include the MVUX hot-reload tests on iOS