Repository navigation
Description
Summary
The E2E test Interactive_DataGrid_ClickEditTabCommit in tests/Reactor.AppTests/Tests/DataGridTests.cs fails on main: after an edit commit lands via the new UseMutation path, cells in rows that underwent state transitions disappear from the UIA tree entirely, and the outer DataGrid's AutomationId (EditableGrid) also becomes unfindable.
This is a pre-existing issue on main (reproduced identically there) — not a regression from any open feature branch.
Reproduction
- Run
dotnet test tests/Reactor.AppTests --filter "FullyQualifiedName~Interactive_DataGrid_ClickEditTabCommit"onmain. - The test fails at line 57 with
Assert.IsNotNull failed. 'Smith' should be visible.
Diagnostic snapshot at failure
Added a temporary diagnostic dump right before the assertion. The commit succeeded (EditStatus shows Last edit: 1:Alicia,Smith), but the UIA tree state after WaitForName("Smith") times out is:
EditStatus text: Last edit: 1:Alicia,Smith ← commit reached state
EditableGrid NOT FOUND ← outer AutomationId gone
TextBlock count: 20
TextBlock texts:
[Loaded: DataGrid_EditableGrid] [Last edit: 1:Alicia,Smith] [3 items]
[Id] [⯆] [First Name] [⯆] [Last Name] [⯆] [Salary] [⯆]
[1] [Alicia] [Smith] ← row 0: missing Salary cell
[2] [Jones] ← row 1: FirstName in TextBox editor, missing Salary
[3] [Carol] [Lee] [$91,000] ← row 2: all 4 cells present
TextBox count: 1, values: [Bob]
The text "Smith" and "Jones" exist in TextBlocks, but their AutomationProperties.Name isn't set — FindByName("Smith") cannot match. Alicia, Carol, Lee are findable by Name. Row 2 (untouched by the edit/commit sequence) renders all 4 cells correctly; rows 0 (committing) and 1 (begin-editing) both lose their trailing Salary cell.
Suspected root cause
Introduced in 49e1fe4 — feat(async): route DataGrid row-commit through UseMutation. The UseMutation.OnOptimistic/OnSuccess callbacks drive state.BeginAsyncCommit / state.CompleteAsyncCommit which fire StateChanged and trigger re-renders of rows that are simultaneously transitioning state (committing vs. newly editing). The DataGridComponent + VirtualList + ChildReconciler interaction appears to drop trailing cells and clear AutomationProperties.Name/AutomationId during those re-renders.
The Reactor DataGrid's correctness at the component level is verified by 423 passing selfhost fixtures (including DataGrid_Edit_*), so this is specifically a UIA-level tree visibility bug exposed only by cross-process Appium queries after an async mutation round-trip — the selfhost tests exercise the reconciler but don't assert against AutomationProperties.Name across the cross-process UIA pipeline.
Suggested investigation path
- Add a selfhost fixture that commits an edit via the
UseMutationpath and then walks the realVisualTreeHelpertree, assertingAutomationProperties.Name/AutomationIdon every cell and on the outer DataGrid. That should reproduce the failure without WinAppDriver. - Suspect areas:
Reconciler.Update.UpdateDefaultAutomationName— the "author override" heuristic may be clearing names afterElementPool.CleanElementon recycled TextBlocks.ChildReconcilerhandling of rows whose cell count stays constant but whose cell types flip (e.g. TextBlock → TextField → TextBlock across a commit).- The Grid cell array construction in
DataGridComponent.RenderRowwhenstate.IsCommitting(rowKey)wraps the row inOpacity(0.6).
- Use the new devtools MCP (
mur devtools) to drive the host app and snapshot the live UIA tree at each state transition.
Workaround for CI
Quarantine the test with [Ignore("See #<this-issue> — DataGrid cells lost from UIA tree after async commit")] until fixed.
Test code
tests/Reactor.AppTests/Tests/DataGridTests.cs:57
Related commit
49e1fe4 feat(async): route DataGrid row-commit through UseMutation
Activity
fix(reconciler): avoid pool-detach in ReconcileImperative to preserve…
fix(34): address PR #36 review comments
Merge pull request #36 from microsoft/fix/34-cell-loss-async-commit
perf: eliminate per-diff allocations in ChildReconciler + KeyedListDiff
perf: eliminate per-diff allocations in ChildReconciler + KeyedListDi…