Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

app-shell previews/FlowCanvas.test.tsx escapes to the real network (ECONNRESET/"socket hang up" noise, different mechanism than #4688/#4697) #4699

Closed

Description

@yinlianghui

Found while verifying objectui#4697's acceptance criteria (measuring the full packages/app-shell/src/views/metadata-admin/ suite before/after that fix). objectui#4697's own card anticipated this: "a remainder from yet another probe is a NEW finding, not this card's."

Mechanism (different from both #4688 and #4697)

Both prior cards were ECONNREFUSED from a plain fetch() (a MetadataClient call in #4697's case, the grid's explain probe in #4688's). This one is a different error code entirely — ECONNRESET / Error: socket hang up — which is what Node's http client throws when a connection is aborted mid-flight, not "nobody is listening." That points at a different transport shape (e.g. a long-lived/streaming connection torn down on unmount) rather than a plain one-shot fetch() rejection.

Measured (worktree objectui-issue-4697, on top of objectui#4697's own fix, commit b65801b2d)

Bisected the same way #4697 bisected its own 180: ran packages/app-shell/src/views/metadata-admin/ in full (167 files, 1671 passed | 1 skipped — no assertion failures either before or after isolating this), saw 20 ECONNRESET lines that #4697's fix does not touch, then binary-searched by directory/file:

Like #4688/#4697, this does not fail any test — FlowCanvas.tsx/FlowCanvas.test.tsx don't reference useMetadataClient, fetch, WebSocket, or EventSource directly in their own source, so the escaping call is coming from something FlowCanvas.tsx imports transitively; not root-caused further here (out of scope for the card that surfaced it).

Suggested direction

Same shape as #3339/#4105/#4688/#4697: trace the transitive import that opens the connection (start from what FlowCanvas.tsx renders/imports beyond the flow-canvas-layout pure helpers) and either stub it in the test or make the hook it comes from skip the connection when no host/adapter is present — whichever precedent fits once the actual call site is found.

Provenance

Measured in worktree objectui-issue-4697 (branch claude/issue-4697-metadata-client-doubles) while verifying objectui#4697, on top of b65801b2d.


Generated by Claude Code

Activity

  1. yinlianghui commented on Aug 15, 2026

    @yinlianghui
    ContributorAuthor

    First-touch grading (seat repo:objectui; session session_01RnQd8iMMUwXQEV1crFmQiQ, 2026-08-15): pm:queue, size S, tests-only, age-ordered — the tail of the network-escape hygiene family (#3339 → #4105 → #4688/#4689/#4698 → #4697/#4700). Different transport mechanism (ECONNRESET/socket-hang-up, 19 lines isolated in previews/FlowCanvas.test.tsx), so the dispatch's first step is identifying the actual call site before picking the double shape — do not assume the metadata client. Sequenced after PR #4700 lands (same test area).


    Generated by Claude Code

  2. self-assigned this
    on Aug 15, 2026
  3. yinlianghui commented on Aug 15, 2026

    @yinlianghui
    ContributorAuthor

    Claim: PM loop round 11 (sequencing cleared — PR #4700 is MERGED, the metadata-admin test area is free)
    Session: session_01RnQd8iMMUwXQEV1crFmQiQ
    Branch: claude/issue-4699-flowcanvas-network-double
    Worktree: objectui-issue-4699
    Domain: repo:objectui
    File surface: packages/app-shell/src/views/metadata-admin/previews/FlowCanvas.test.tsx (+ a second file only if the measured call site demands a sibling stub) + the tests-only empty-frontmatter changeset if the presence gate demands one. ⛔ No production source (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: sonnet
    Serial constraints cleared: in-flight is only objectstack#8830 (other repo); no open dev PR touches this file (checked this round).


    Generated by Claude Code

  4. yinlianghui commented on Aug 15, 2026

    @yinlianghui
    ContributorAuthor
    {
      "issue": 4699,
      "status": "done",
      "branch": "claude/issue-4699-flowcanvas-network-double",
      "pr": "https://github.com/objectstack-ai/objectui/pull/4702",
      "premise_still_valid": true,
      "summary": "Measured (not assumed) the transport: FlowCanvas -> useFlowNodePalette -> useActionDescriptors fires a real GET /api/v1/automation/actions on every mount via a mount-time useEffect, aborted (AbortController) on unmount. This repo's vitest `dom` project has no fetch mock, so global fetch resolves to happy-dom's OWN polyfill (backed by Node's http/https core client, not undici -- happy-dom/lib/fetch/Fetch.js imports 'http' directly), which is why the escape surfaces as ECONNRESET/socket-hang-up (node:_http_client stack frames) instead of the instant ECONNREFUSED the undici-based fetch family (#4688/#4697) produces. Instrumented global.fetch to confirm: exactly 19 calls to '/api/v1/automation/actions', matching the 19 tests 1:1. Fixed by stubbing global.fetch for that exact endpoint in FlowCanvas.test.tsx only (beforeEach/afterEach, vi.stubGlobal/vi.unstubAllGlobals), degrading with a 404 -- the same 'engine absent' response the hook already falls back from -- so NODE_PALETTE fallback behavior is unchanged.",
      "tests": "Baseline reproduced isolated (--maxWorkers=1): 19 'socket hang up' lines, exit 0, 19 passed (19) -- matches issue's exact count. After fix, same isolated run: 0 noise lines, 19 passed (19), every assertion unchanged. Full previews/ directory suite: 37 files passed (37), 441 tests passed (441) (1 residual socket-hang-up line remains from a DIFFERENT sibling file, flow-canvas-seeds.spec-parse.test.tsx, which independently renders a FlowCanvas element with no stub of its own -- filed unassigned as #4701, out of scope here). Reverse verification (fix committed first, HEAD b4eac2291): git checkout origin/main -- the file path restored the pre-fix file -> re-ran isolated -> 19 socket-hang-up lines returned, 19 passed (19) (predicted red/noise-returns direction confirmed) -> restored via git checkout claude/issue-4699-flowcanvas-network-double -- the file path -> re-ran -> back to 0 noise / 19 passed. Local gate union at HEAD b4eac2291: `pnpm --filter '@object-ui/app-shell^...' build` (dependency closure) green; `pnpm --filter @object-ui/app-shell run type-check` green; `pnpm exec eslint --quiet packages/app-shell/src/views/metadata-admin/previews/FlowCanvas.test.tsx` clean; `node scripts/check-changeset-presence.mjs` green (empty-frontmatter changeset declared, tests-only); `node scripts/check-changeset-no-major.mjs` green; `pnpm run check:control-bytes` OK. scripts/pm/dispatch-gates.mjs does not exist in this repo (checked); re-derived implicated gates by hand against the 2-file diff (1 test file + 1 changeset) -- no new error codes, no .claude/agents/** changes, no new fake engine, no i18n call-site changes, so no family beyond the ones named/run above is implicated. PR labeled tests + skip-changeset (matching #4700's precedent for this same tests-only family), read back after write to confirm: ['tests','skip-changeset'].",
      "open_questions": [],
      "out_of_scope_findings": [
        "filed as #4701: app-shell previews/flow-canvas-seeds.spec-parse.test.tsx independently renders a FlowCanvas element with no fetch stub of its own, so it exercises the same ECONNRESET/socket-hang-up escape #4699 fixed in FlowCanvas.test.tsx (1 line isolated, 25 passed (25), harmless noise, same remedy applies)"
      ]
    }

    Generated by Claude Code

  5. yinlianghui commented on Aug 15, 2026

    @yinlianghui
    ContributorAuthor

    ACCEPT — PR #4702 (reviewer of record; readings taken on GitHub at head b4eac2291, matching the report's gate-union HEAD) with one correction applied.

    CI on this head is converging — ready + auto-merge flips when the gates conclude green (timer armed). Card closes on merge; pm:dispatched comes off then. #4701 graded on its own card.


    Generated by Claude Code

  6. added a commit that references this issue on Aug 17, 2026
    03e98fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions