LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtSep 23, 2026, 2:29 AM
updatedAtSep 23, 2026, 3:38 AM
githubUrlhttps://github.com/neomjs/neo/issues/19071
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 23, 2026, 3:38 AM

Four catches decide "departed window" with three different predicates

Closed v13.2.0/archive-v13-2-0-chunk-22 enhancementairefactoringcore
neo-opus-grace
neo-opus-grace commented on Sep 23, 2026, 2:29 AM

Context

#19061 (#19056) settles an unhandled NEO_DEAD_PORT rejection only when the window it targeted departed: reason.code === 'NEO_DEAD_PORT' && isWindowDeparted(reason.windowId ?? reason.destination). That is the two-half predicate #18741 established. Four call sites catch the same rejection themselves, because each also has a second purpose: naming its subsystem, or settling Neo.isDestroyed. They decide "departed" in two different ways:

site predicate
container/Viewport.mjs:144 both halves (NEO_DEAD_PORT + isWindowDeparted(windowId))
draggable/DragZone.mjs:445 code only
grid/Body.mjs:1321 code only (+ Neo.isDestroyed)
table/Body.mjs:631 code only (+ Neo.isDestroyed)

The Problem

The code-only sites swallow a dead port whose window never existed, which is a real misroute. #19067 is the latest proof that one exists: a message for a departed window was being delivered to a sibling. The central boundary would surface that error; these four sites silence it. It is the same rule written four times with two meanings. @neo-opus-ada agreed to the shared predicate on #19061's fork.

The Fix

Add one predicate, worker.Base#isDeparture(reason, windowId), that answers the two halves. onUnhandledRejection and the four catches call it in place of their inline tests. The code-only sites tighten to both halves; their Neo.isDestroyed handling and subsystem messages stay as they are.

Acceptance Criteria

  • AC-1 — isDeparture exists on worker.Base, and onUnhandledRejection uses it with no change in behaviour (the existing WindowDeparture arms stay green).
  • AC-2 — Each of the four sites uses it. A departed window stays silent there, and a never-known dead port now reaches its subsystem's console.error. One unit arm per site covers the newly visible case.
  • AC-3 — No inline NEO_DEAD_PORT comparison remains in src outside worker/Base.mjs.

Out of Scope

  • Deleting any of the four catches. Each has a named second purpose (#19061's AC-4).
  • The DomEvent and Overflow sites, which check before the call and skip the work.

Related

  • #19056 / #19061 — central settlement
  • #18741 — the departure predicate
  • #19067 — the misroute a code-only predicate hides
  • #19011 — Viewport's both-halves precedent

Sweeps: live latest-open at 2026-09-23T00:29Z; open issues for isDeparture: none. Own assignments: none overlapping.

Origin Session ID: 19051047-2f38-4bf0-be51-efd6b957564d

Retrieval Hint: query_raw_memories("isDeparture shared predicate NEO_DEAD_PORT code-only catches Viewport DragZone grid Body table Body")

tobiu referenced in commit 057aed8 - "refactor(worker): every settlement asks one departure predicate, and all of them ask both halves (#19071) (#19073) on Sep 23, 2026, 3:38 AM
tobiu closed this issue on Sep 23, 2026, 3:38 AM