fix: address Copilot review round 4 on #2318

- fetchTracking: one non-throwing reporter fronts every stream update —
  the open (inside the fetch wrapper), each coalesced count (from a
  timer) and the close (off the discarded watcher).
- rawWireRequest annotates a request timeout its transport's send
  rejects with, so the browser's relay timeout on a raw-wire call reads
  like every other.
- RemoteClientTransport reports still-open streams closed on close(),
  since the backend watcher's own close cannot reach a channel that the
  disconnect has already torn down.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01APKSYHGxXBUpnR7ErFiLJn
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-09-13 23:20:28 -04:00
commit abc4967298

View file

@ -2980,7 +2980,17 @@ export class InspectorClient extends InspectorClientEventTarget {
clearTimeout(pending.timer);
this.pendingRawWireRequests.delete(id);
}
reject(err instanceof Error ? err : new Error(String(err)));
// The browser's remote transport awaits the response inside `send`,
// so its relay wait can expire here first, as the SDK's timeout
// shape; annotate it exactly as the local timer above does (a
// non-timeout error passes through untouched).
reject(
annotateRequestTimeout(
err instanceof Error ? err : new Error(String(err)),
method,
this.getConnectionDiagnostics(),
),
);
});
});
return resultSchema.parse(raw);