fix(web): the chat view and composer no longer keep old renders alive #19869
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 5 commits into
main fromrefs/pull/19869/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
juliusmarminge added labelsmacroscope-review
- scripts/find-render-scope-leaks.ts line 43OutdatedResolvedby t3dotgg(GitHub profile, opens in a new tab)@@ -0,0 +23,21 @@23+ * Every round also types into the composer and toggles the open thread's pin.24+ * Never point --base-dir at the live ~/.t3; use a dev server's own state.25+ */26+import * as NodeFS from "node:fs";27+import * as NodeOS from "node:os";28+import * as NodePath from "node:path";29+import * as NodeUtil from "node:util";30+import { chromium, type Page } from "playwright-core";31+32+const { values: args } = NodeUtil.parseArgs({33+ options: {34+ url: { type: "string" },35+ rounds: { type: "string", default: "30" },36+ warmup: { type: "string", default: "5" },37+ "base-dir": { type: "string" },38+ thread: { type: "string" },39+ stream: { type: "boolean", default: false },40+ },41+});42+if (!args.url) throw new Error("--url is required (the dev runner's pairing URL)");43+const rounds = Number(args.rounds);scripts/find-render-scope-leaks.ts line 65OutdatedResolvedby t3dotgg(GitHub profile, opens in a new tab)@@ -0,0 +45,21 @@45+if (baseDir) {46+ // The live install's settings must never be rewritten, even through a symlink.47+ const real = (path: string) => (NodeFS.existsSync(path) ? NodeFS.realpathSync(path) : path);48+ const live = real(NodePath.join(NodeOS.homedir(), ".t3", "userdata"));49+ const target = NodePath.join(baseDir, "userdata");50+ if (real(target) === live || real(NodePath.join(target, "settings.json")).startsWith(`${live}/`))51+ throw new Error("--base-dir points at the live ~/.t3; use a dev server's own state");52+}53+const workDir = NodePath.join(NodeOS.tmpdir(), "t3-render-scope-leaks");54+NodeFS.mkdirSync(workDir, { recursive: true });55+const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));56+57+const browser = await chromium.launchPersistentContext(NodePath.join(workDir, "profile"), {58+ headless: true,59+ viewport: { width: 1400, height: 900 },60+});61+const page = browser.pages()[0] ?? (await browser.newPage());62+await page.goto(args.url);63+const composer = page.locator("[contenteditable=true]").first();64+await composer.waitFor({ timeout: 60_000 });65+if (args.thread) await page.getByText(args.thread, { exact: true }).first().click();
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Macroscope skipped reviewing this pull request. Per-review cost limit exceeded (workspace setting).
This review would cost an estimated $15.30, which exceeds your per-review limit of $15.00.
The top 3 files driving up this estimate:
apps/web/src/components/ChatView.tsxapps/web/src/components/chat/ChatComposer.tsxdocs/internals/web-ui.mdTip
To get this pull request reviewed, you can:
@macroscope-appon this PR to request a manual review (monthly spend limits still apply)..macroscope/ignore.md— note that creating this file replaces Macroscope's built-in default ignores rather than extending them.