LearnNewsExamplesServices
Frontmatter
id8823
titletest: Investigate RealWorldUpdates Regression
stateClosed
labels
bugaitesting
assigneestobiu
createdAtJan 20, 2026, 4:25 AM
updatedAtJan 20, 2026, 12:08 PM
githubUrlhttps://github.com/neomjs/neo/issues/8823
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 20, 2026, 12:08 PM

test: Investigate RealWorldUpdates Regression

Closed v11.23.0 bugaitesting
tobiu
tobiu commented on Jan 20, 2026, 4:25 AM

The recent VDOM race condition fixes (Ticket #8814) introduced a regression in test/playwright/unit/vdom/RealWorldUpdates.spec.mjs.

Symptoms:

  • Tests fail with 0 or 1 delta received instead of expected 2.
  • Specifically, child updates are not being merged into the parent update or are being serialized such that promiseUpdate() only captures the parent's delta.

Root Cause Analysis: The fix enforces serialization (isChildUpdating) to prevent race conditions. RealWorldUpdates.spec.mjs seems to rely on an implicit merging behavior or parallel execution assumption that allowed it to capture both updates in a single promiseUpdate call (or expected them to be bundled). The new logic forces the parent to wait, potentially splitting the updates into separate transactions that the test doesn't capture correctly.

Action Item: Investigate if RealWorldUpdates.spec.mjs needs to be updated to reflect the new serial execution model, or if the VDomUpdate manager should support a merging strategy that accommodates this test case without re-introducing the race condition. Reference: Paradox between AsymmetricUpdates (forbids merging Depth 1) and RealWorldUpdates (expects merging/bundling).

tobiu added the bug label on Jan 20, 2026, 4:25 AM
tobiu added the ai label on Jan 20, 2026, 4:25 AM
tobiu added the testing label on Jan 20, 2026, 4:25 AM
tobiu assigned to @tobiu on Jan 20, 2026, 4:55 AM
tobiu referenced in commit fc1bd2d - "test: Fix RealWorldUpdates regression via test logic and add VdomMerging test (#8823)" on Jan 20, 2026, 12:07 PM
tobiu
tobiu Jan 20, 2026, 12:08 PM

Input from Gemini 3 Pro:

✦ I have resolved the regression in RealWorldUpdates.spec.mjs.

Root Cause: The test relied on parent.setSilent to bundle parent and child updates. However, the child update (triggered by heading setter) ran synchronously before the parent was marked as dirty (needsVdomUpdate). This caused the child to fail the merge check (because the parent appeared clean) and run disjointly. This disjoint execution is valid for Scoped Updates (< collision logic), but the test expected a bundled result (aggregation).

Solution:

  1. Refactored Test Logic: Updated RealWorldUpdates.spec.mjs to ensure the parent is explicitly dirty (e.g., via a style change) before the child update is triggered. This is achieved by ordering the properties in setSilent ({style: ..., heading: ...}).
  2. Enabled Optimization: Implemented canMergeUpdate in VdomLifecycle (using <=) to allow safe merging of disjoint updates (e.g., Parent Depth 1 + Child Depth 1) when the parent is already updating.
  3. Added Regression Test: Created test/playwright/unit/vdom/VdomMerging.spec.mjs to explicitly verify this merging behavior in a clean, isolated environment.

All tests are now passing (8/8 in RealWorldUpdates, 1/1 in VdomMerging). The architecture remains consistent with Scoped VDOM Updates while supporting optimization where possible.

tobiu closed this issue on Jan 20, 2026, 12:08 PM
tobiu cross-referenced by #8826 on Jan 20, 2026, 12:21 PM