LearnNewsExamplesServices
Frontmatter
id8625
titleFragment Move Operation Instability
stateClosed
labels
bugairegression
assigneestobiu
createdAtJan 14, 2026, 1:15 AM
updatedAtJan 14, 2026, 1:59 AM
githubUrlhttps://github.com/neomjs/neo/issues/8625
authortobiu
commentsCount1
parentIssue8601
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 14, 2026, 1:59 AM

Fragment Move Operation Instability

Closed v11.21.0 bugairegression
tobiu
tobiu commented on Jan 14, 2026, 1:15 AM

The Fragment example app (examples/container/fragment/) reveals a bug where repeatedly clicking the "Move Field 1 into Fragment" button (attempting to insert an item that is already at the target index in the Fragment) causes random reordering of items and eventual data loss (Fragment becomes empty).

Steps to Reproduce:

  1. Open the Fragment example app.
  2. Click "Move Field 1 into Fragment". (Works correctly).
  3. Click "Move Field 1 into Fragment" again.
  4. Repeat.

Expected Behavior: Subsequent clicks should be a no-op as the item is already in place.

Actual Behavior: Items randomly reshuffle, and the Fragment eventually loses its content.

Root Cause Analysis:

  • DeltaUpdates likely mishandles move operations involving Fragments when the source and target are effectively the same or when the operation should be a no-op.
  • Potential index corruption in Fragment or Container during repeated re-insertion.

See Also:

  • Issue #8627 (No-op fix for Container.insert)
  • Issue #8616 (Parent Task)
tobiu added the bug label on Jan 14, 2026, 1:15 AM
tobiu added the ai label on Jan 14, 2026, 1:15 AM
tobiu added the regression label on Jan 14, 2026, 1:15 AM
tobiu added parent issue #8601 on Jan 14, 2026, 1:15 AM
tobiu referenced in commit d433c61 - "test: Verify Container.insert no-op stability (#8625)" on Jan 14, 2026, 1:58 AM
tobiu assigned to @tobiu on Jan 14, 2026, 1:59 AM
tobiu
tobiu Jan 14, 2026, 1:59 AM

Input from Gemini 3 Pro:

✦ I have verified that the fix implemented in #8626 (Container.insert no-op optimization) successfully resolves the instability reported here.

Verification:

  • Created a new unit test test/playwright/unit/container/InsertNoOp.spec.mjs which confirms that repeatedly inserting an item into its current index is now a no-op and does not corrupt the Container's items array or VDOM structure.
  • This prevents the "Fragment empty" and random reordering issues caused by redundant insert operations.

Changes committed and pushed.

tobiu closed this issue on Jan 14, 2026, 1:59 AM