LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtOct 16, 2026, 8:59 PM
updatedAtOct 16, 2026, 10:19 PM
githubUrlhttps://github.com/neomjs/neo/issues/19830
authorneo-opus-ada
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 16, 2026, 10:17 PM

A functional component destroyed mid-update freezes its ancestors' updates

neo-opus-ada
neo-opus-ada commented on Oct 16, 2026, 8:59 PM

Context

Found while attributing a unit flake on neo #19825 (run 38948640859, job 117135130702, at 07b3c818d1). ViewLoadingReprojection.spec.mjs › "the expected teardown cancellation is consumed silently" records every console.error for 50 ms and expects none. It caught vdom update wedged: "cmp-scroll-1". That id belongs to the functional MockComponent of unit/functional/ScrollState.spec.mjs, which that spec destroys in its afterEach. A destroyed component's wedge watchdog fired into another spec's window. The same PR had an earlier red in this spec at :159.

A local unit probe on dev eedc33c3dd registers a flight that never replies, then destroys the component:

component destroyed mid-flight after destroy() 120 ms later (threshold 50 ms) its parent's next update, 400 ms later
component.Base (control) in-flight entry and watchdog released; gone from the parent's descendantInFlightMap no error resolved
functional.component.Base in-flight entry and watchdog still set; still in the parent's map vdom update wedged: "neo-functional-component-1" still pending

The Problem

Destroying a functional component during its VDOM flight leaves the flight registered. The dead component then:

  • gets reported as wedged by the watchdog, a false alarm and a cross-spec flake source;
  • stays in each ancestor's descendantInFlightMap, so an ancestor's next update yields to it and never settles. In an app, the parent container stops updating.

The Architectural Reality

  • VdomLifecycle registers flights through VDomUpdate.registerInFlightUpdate. component.Abstract mixes it in for both component families: component.Base and functional.component.Base both extend Abstract.
  • #14923 (#14911) made destruction "a complete render-flight cancellation boundary" with three calls: rejectCallbacks(id, Neo.isDestroyed), unregisterInFlightUpdate(id) and triggerPostUpdates(id). It placed them in component.Base#destroy (src/component/Base.mjs:1415–1426), so the functional family never got them. Abstract#destroy (src/component/Abstract.mjs:361–366) has none.
  • unregisterInFlightUpdate is also what clears the watchdog timer and removes the id from every parent's descendantInFlightMap (src/manager/VDomUpdate.mjs:702–720).
  • Design authority: #14911 / #14923, and component.Base#destroy's own comment ("a lingering one makes every ancestor update yield to it forever").

The Fix

  • Move the boundary, its three calls and their comment, from component.Base#destroy to the top of component.Abstract#destroy, the class that mixes in VdomLifecycle.
  • component.Base keeps its order: its own teardown, then super.destroy(), which now runs the boundary before Abstract's DOM-event and registry teardown, as before.
  • functional.component.Base#destroy reaches it through super.destroy().
  • Lines move; no line is added beyond the move.

Acceptance Criteria

  • AC-1: a functional component destroyed during a flight releases its in-flight entry and watchdog, and no "wedged" error follows. Unit test in VdomDestroyCancellation.spec.mjs, red on dev.
  • AC-2: its parent's next update resolves. Unit test, red on dev: pending.
  • AC-3: component.Base's existing cancellation arms stay green and unchanged, and the promises parked on a functional flight settle with the destroy sentinel.
  • AC-4: the full unit suite and the component suites pass.

Out of Scope

  • ViewLoadingReprojection.spec.mjs's capture window, which accepts any console.error in the worker. With this fix the dead component no longer writes there, but the window stays broad; a separate hygiene question.
  • Why ScrollState.spec.mjs leaves a flight open at teardown: a test needs to be able to destroy a component mid-flight.

Related

#14911 · #14923 · #12946 (the watchdog) · neo #19825 (sighting)

Decision Record impact: none.

Live latest-open sweep: latest 20 open issues at 18:58Z, no equivalent; gh search issues "functional destroy flight" (open) found nothing. A2A sweep: the latest 30 messages, all read states; no claim on this scope. MC sweep: one query on the symptom; #14923's record placed the boundary in component.Base and records no decision about functional components. Own-assignment sweep: no open ticket of mine on this surface.

Origin Session ID: ac1f92da-06ba-4c59-8e6e-25a2d1397d69

Retrieval Hint: "functional component destroy in-flight vdom update watchdog wedged ancestor yields"

tobiu referenced in commit ebe5386 - "fix(component): a functional component destroyed mid-update releases its render flight (#19830) (#19831) on Oct 16, 2026, 10:17 PM
tobiu closed this issue on Oct 16, 2026, 10:17 PM