LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-euclid
createdAtOct 13, 2026, 9:48 PM
updatedAtOct 13, 2026, 10:25 PM
githubUrlhttps://github.com/neomjs/neo/issues/19727
authorneo-gpt-euclid
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[x] 19569 Film tour: restoring a perspective re-births a closed window
closedAtOct 13, 2026, 10:25 PM

In-flight retired-port errors lack departure identity

Closed v13.3.0/archive-v13-3-0-chunk-1 bugaitestingcore
neo-gpt-euclid
neo-gpt-euclid commented on Oct 13, 2026, 9:48 PM

Context

The real #19569 restored-stack return logged DragZone: proxy removal delta failed with PortDisconnectedError just after its popup closed. A zero-file-change probe at f502257a3a independently dispatched a real WorkerBase.promiseMessage(), retired its target port and observed the same classification failure. Grace independently verified the emitter and found no open owner.

The Problem

removePort() records the window departure before rejecting pending requests, but the emitted error has only name: 'PortDisconnectedError'. Its code and windowId are absent. The existing shared isDeparture() therefore returns false even though the actual target departure is recorded. The unhandled boundary mirrored this rejection once instead of settling it as expected teardown.

A request sent after departure already carries the typed dead-port metadata and classifies correctly. The missing case is a request that was dispatched before the port retired.

The Architectural Reality

Design authority: src/worker/Base.mjs#isDeparture states “Both halves, always”: NEO_DEAD_PORT plus recorded target departure. #19071 established that predicate; its completed scope did not cover this emitter. The merged #19536 / closed #19535 repair handles a specific Workstation repaint consumer by error name, leaving the shared emitter unchanged.

removePort owns the pending-request rejection. DragZone, Viewport, grid/table bodies and other shared-predicate consumers should receive the same existing departure contract. Name-based handlers in Neo.mjs, VdomLifecycle and worker/App.mjs still need the existing error name.

Prescription checked: src/worker/Base.mjs#removePort owns the concern. No new consumer predicate or teardown wait is needed.

The Fix

Add code: 'NEO_DEAD_PORT' and the retired port's windowId to its in-flight rejection, retaining PortDisconnectedError and the existing message. Keep pending-map deletion, exact port-generation ownership and the recorded-departure predicate unchanged.

Contract Ledger

Surface Authority Behavior / fallback Docs Evidence
WorkerBase.removePort rejection Existing typed departure contract / #19071 In-flight retired-window requests expose code and target identity; error name/message remain compatible. Non-window ports acquire no departure evidence. Owning JSDoc Real dispatched window and channel requests, then exact port retirement.
WorkerBase.isDeparture and unhandled settlement Existing two-halves JSDoc Recorded target departure settles silently; ordinary, unknown or foreign-window failures remain visible. Predicate unchanged. Existing JSDoc Actual emitted reason plus negative controls and unhandled-boundary observation.
Generation fencing Existing ReplyLoss contract A retired/foreign port does not reject a successor request or admit its stale reply. Existing source Existing successor tests and focused regression.

Decision Record impact: none — restores the existing transport terminal; no new architecture or configuration.

Acceptance Criteria

  • A real in-flight window request rejected by removePort carries the existing error name/message, NEO_DEAD_PORT, and exact target window ID; its pending entry is deleted.
  • The same holds for an in-flight channel request routed through that window; a non-window port remains a non-departure.
  • The actual emitted reason satisfies the existing two-halves predicate and settles at the unhandled boundary. Ordinary and foreign-window failures remain observable.
  • Successor-port request/reply isolation remains intact. Owning worker tests and a real DragZone cleanup consumer control cover the repair.

Out of Scope

No broad suppression by error name, new waits, changed departure retention, consumer predicate proliferation, or retirement-policy change. The film choreography and headed placement remain #19569. No hosted quarantine is retired under this ticket.

Related

#19071 · #18741 · #19535 · #19569 · #19655

MC sweep: pending render / popup closure / in-flight departure queries surfaced the prior #19536 review and the current #19569 diagnosis; live #19536 is merged and consumer-specific. Own-assignment sweep: four open; #19569 and #17844 bodies read, neither owns this shared emitter repair. Live latest-open sweep: checked20 newest open issues at 2026-10-13 19:48:32 UTC; no equivalent. Fresh open PR search found none. In-flight mailbox sweep: latest30 messages in all read states, no competing claim; Grace explicitly declined implementation.

Origin Session ID: c8bb5531-a290-4eb2-af1a-6623deffda27 Retrieval Hint: “removePort in-flight PortDisconnectedError missing departure identity isDeparture”

tobiu referenced in commit ff08389 - "fix(worker): identify in-flight window departures (#19727) (#19728)" on Oct 13, 2026, 10:25 PM
tobiu closed this issue on Oct 13, 2026, 10:25 PM