Repository navigation
fix(android): Re-arm first-frame gate on Activity recreation - #24599
Conversation
|
Claude finished @MartinZikmund's task in 4m 7s —— View job Review complete ✅Todo list
Verdict: Ship (1 minor finding, non-blocking)This is a solid root-cause fix, not a guard-only patch — matching the debugging-discipline requirements:
One inline finding posted (informational, not a correctness bug): the new test isn't annotated with Not flagged as blocking, worth a look: the test's |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24599/wasm-skia-net9/index.html |
|
Claude finished @MartinZikmund's task in 1m 44s —— View job Review complete ✅Todo list
Verdict: Ship (0 new findings)This re-review covers the branch since the last automated pass. The only change since then is commit
No correctness, lifecycle, or test-coverage issues found in this delta. The rest of the diff ( Still open, non-blocking (carried over from the prior review): the new test method still doesn't carry |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24599/wasm-skia-net9/index.html |
|
The build 235243 found UI Test snapshots differences: Details
|
|
|
The Skia first-frame gate is armed on every ApplicationActivity creation, but the render views kept their own "first frame signaled" flag. They outlive a recreated Activity, so after a relaunch nothing ever released the gate: OnPreDraw cancelled every draw of the new window, and each cancelled draw re-schedules a traversal whose sync barrier limits the dispatcher to one item per frame. Idle work then took 10-50 s to run, which is what hangs the Android runtime-test shards on CI when the late PACKAGE_ADDED broadcast relaunches the Activity. The gate is now the single source of truth: the first frame presented after it is armed releases it. A recreated Activity also requests that frame explicitly, as the reused render view may otherwise stay idle. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01WHHcu5U9N25wvKGNFCrpJm
Activity.Recreate (and any relaunch that preserves the window) crashed with a NullReferenceException: NativePage.OnCreate runs InitializeComponent, which reparents the reused content into the kept, already attached window. The attach handler then starts the LayoutProvider, which ApplicationActivity.OnCreate only created after base.OnCreate returned. The LayoutProvider is now created on first use, so it exists whenever the content is attached. OnCreate still creates it at the same point as before for a fresh Activity. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01WHHcu5U9N25wvKGNFCrpJm
Recreates the ApplicationActivity and checks that 300 empty dispatcher items still drain quickly. Without the first-frame gate fix the new window keeps cancelling its draw and the drain takes ~5 s; with it, well under the 2 s bound. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01WHHcu5U9N25wvKGNFCrpJm
The DynamicDependency attributes name Android-only assemblies, which the trimmer reports as IL2035 on the Apple heads, where it fails the build. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01WHHcu5U9N25wvKGNFCrpJm
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
a7d59ed to
1359f47
Compare
|
Claude finished @MartinZikmund's task in 43s —— View job Review complete ✅Todo list
Verdict: Ship (0 new findings)The only change since the last automated review is commit [GitHubWorkItem("https://github.com/unoplatform/uno/issues/24598")]to No other findings, open or new. The rest of the diff is unchanged from the prior passes and still holds up as a root-cause fix per
No cross-cutting concerns remain. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24599/wasm-skia-net9/index.html |
OnDestroy raised the native close for every Activity destruction, so a configuration-driven recreation (rotation, density change, Recreate) closed the Uno window even though its content is carried over to the new Activity. Ported from #24586. Co-Authored-By: morning4coffe-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GwbrDBytd9CFt9aZoV8s1o
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GwbrDBytd9CFt9aZoV8s1o
|
Claude finished @MartinZikmund's task in 2m 36s —— View job Review complete ✅Todo list
Verdict: Ship (1 minor, non-blocking finding)The delta since the last automated review is two new commits:
One minor, non-blocking finding posted inline: the new test duplicates the "reflect No cross-cutting concerns remain; the rest of the diff (render views, |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24599/wasm-skia-net9/index.html |
|
The build 235495 found UI Test snapshots differences: Details
|
morning4coffe-dev
left a comment
There was a problem hiding this comment.
LGTM! Fixes the Android first-frame gate on Activity recreation by removing the per-view state that outlived the Activity. Great root-cause fix with runtime tests.
|
Claude finished @MartinZikmund's task in 2m 11s —— View job Review complete ✅Todo list
Verdict: Ship (0 new findings)This "reopened" trigger re-runs against the same
Cross-cutting, still open from a prior pass (non-blocking, not re-filed as a duplicate inline comment): the "reflect No new concerns beyond what's already been reviewed and approved (@morning4coffe-dev). |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24599/wasm-skia-net9/index.html |
|
The build 235599 found UI Test snapshots differences: Details
|
GitHub Issue: closes #24598
PR Type:
🐞 Bugfix
What changed? 🚀
This is the main cause of red master CI builds. Android Skia runtime-test shards get canceled at the 45-minute job cap in about 12 of the last 30 master builds; a healthy shard takes 8-11 minutes.
What happens. In every hung shard, the Activity is relaunched in the same process a few seconds into the run. It shows as
SurfaceDestroyed, thenOnSuspending/OnResuming, then a secondVulkan rendering initialized. The trigger is the app's ownPACKAGE_ADDEDbroadcast arriving late: in healthy runs it lands befoream start. That's 5 of 5 hung shards vs 0 of 23 healthy ones. After the relaunch, the app's HWUIapp_time_statsstop (0-8 frames vs 276-428 in healthy shards), andWaitForIdletakes 10-50 s per call.Root cause.
ApplicationActivity.OnCreatere-armsNativeWindowWrapper's first-frame gate (the splash / white-flash fix)._firstFrameSignaledis alreadytrue, so nothing ever releases the gate again.OnPreDrawreturnsfalseforever.ViewRootImplthen cancels each draw and re-schedules a traversal every frame.NativeDispatcher's Handler posts to about one item per vsync.Fix.
fix(android): Re-arm first-frame gate on Activity recreation: the gate is now the single source of truth. The first frame presented after arming releases it (TryReleaseFirstFrameGate, interlocked), both render views drop their own flag, and a recreated Activity requests a frame explicitly.fix(android): Avoid crash when the Activity is recreated in place:Activity.Recreate()crashed with an NRE becauseInitializeComponentattaches the reused content beforeOnCreatecreated theLayoutProvider. It is now created lazily, at the same point as before for a fresh Activity.fix(android): Keep the window open on configuration recreation:OnDestroyraised the native close for every destruction, soRecreate(), a rotation or a density change closed the Uno window whose content the new Activity keeps. It now skips that whenIsChangingConfigurationsis set. Ported from fix(android): restore Skia content after activity recreation #24586 (@morning4coffe-dev), which fixed the same two bugs independently and is closed in favor of this PR.Validation
wm density 400) duringComboBoxIntegrationTests:Given_ApplicationActivity.When_Recreated_Dispatcher_Stays_Responsive(Skia Android only):RecreateNRE.When_Recreated_Window_Stays_Open(checksWindow.Closedis not raised). Its runtime evidence is this CI run.Risks
PACKAGE_ADDEDbroadcast sometimes arrives late on the CI emulator. Waiting for it befoream startwould be a possible CI-side mitigation.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01WHHcu5U9N25wvKGNFCrpJm