Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/client/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,11 @@ const ChatViewInner = forwardRef<ChatViewHandle, Props>(function ChatView({ sess
// ping-pong bug). A pin sets scrollTop, not scrollHeight, so the next
// onChange sees no growth and the loop cannot sustain itself.
onChange: () => {
// Virtualizer may fire notify after jsdom teardown (suite-level
// unhandled "window is not defined"). Bail when unmounted / no DOM.
if (typeof window === "undefined") return;
const el = scrollRef.current;
if (!el) return;
if (!el || !el.isConnected) return;
const prevH = lastScrollHeightRef.current;
const nextH = el.scrollHeight;
if (nextH === prevH) return;
Expand Down
59 changes: 32 additions & 27 deletions scripts/__tests__/test-up-port-derivation.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -159,33 +159,38 @@ describe("test-up.sh state file", () => {
});

describe.skipIf(!hasDocker())("compose interpolation (requires docker)", () => {
it("published port tracks listen port + container env", () => {
const out = execFileSync(
"docker",
[
"compose",
"-f",
path.join(DOCKER_DIR, "compose.yml"),
"-f",
path.join(DOCKER_DIR, "compose.test.yml"),
"config",
],
{
cwd: DOCKER_DIR,
env: { ...process.env, DASHBOARD_PORT: "18042", PI_GATEWAY_PORT: "19042", HOST_CWD: "/tmp" },
encoding: "utf8",
},
);
// Published host port == in-container listen port (no drift), dashboard.
expect(out).toMatch(/published:\s*"?18042"?/);
expect(out).toMatch(/target:\s*18042/);
// Container env DASHBOARD_PORT tracks the exported value.
expect(out).toMatch(/DASHBOARD_PORT:\s*"?18042"?/);
// Same for the gateway port — guards against the gateway env re-hardcoding.
expect(out).toMatch(/published:\s*"?19042"?/);
expect(out).toMatch(/target:\s*19042/);
expect(out).toMatch(/PI_GATEWAY_PORT:\s*"?19042"?/);
});
it(
"published port tracks listen port + container env",
() => {
const out = execFileSync(
"docker",
[
"compose",
"-f",
path.join(DOCKER_DIR, "compose.yml"),
"-f",
path.join(DOCKER_DIR, "compose.test.yml"),
"config",
],
{
cwd: DOCKER_DIR,
env: { ...process.env, DASHBOARD_PORT: "18042", PI_GATEWAY_PORT: "19042", HOST_CWD: "/tmp" },
encoding: "utf8",
timeout: 60_000,
},
);
// Published host port == in-container listen port (no drift), dashboard.
expect(out).toMatch(/published:\s*"?18042"?/);
expect(out).toMatch(/target:\s*18042/);
// Container env DASHBOARD_PORT tracks the exported value.
expect(out).toMatch(/DASHBOARD_PORT:\s*"?18042"?/);
// Same for the gateway port — guards against the gateway env re-hardcoding.
expect(out).toMatch(/published:\s*"?19042"?/);
expect(out).toMatch(/target:\s*19042/);
expect(out).toMatch(/PI_GATEWAY_PORT:\s*"?19042"?/);
},
60_000,
);
});

if (!hasDocker()) {
Expand Down
Loading