{"draft":null,"from":41,"to":318,"files":[{"path":"client/test/attach.test.ts","added":16,"removed":1,"diff":"--- a/client/test/attach.test.ts\n+++ b/client/test/attach.test.ts\n@@ -86,6 +86,9 @@\n \t\t\tres.writeHead(404).end(\"{}\");\n \t\t});\n \t});\n+\t// As fake-server.ts: never close an idle kept-alive connection, or under load the client can reuse one as it closes\n+\t// and fail with ECONNRESET (abso 410).\n+\tissues.keepAliveTimeout = 0;\n \tawait new Promise<void>((ok) => issues.listen(0, \"127.0.0.1\", ok));\n \tissuesUrl = `http://127.0.0.1:${(issues.address() as AddressInfo).port}`;\n });\n@@ -133,7 +136,7 @@\n \t\t\tcalls.map((c) => `${c.method} ${c.url.replace(/^\\/p\\/[^/]+/, \"\")}`),\n \t\t\t[\"POST /a/ann/attachments\", \"POST /a/ann/attachments\", \"POST /a/ann/issue\"],\n \t\t);\n-\t\tassert.equal(calls[0]!.headers[\"x-avcs-name\"], \"shot.png\");\n+\t\tassert.equal(calls[0]!.headers[\"x-abso-name\"], \"shot.png\");\n \t\tassert.equal(calls[0]!.headers[\"content-type\"], \"application/octet-stream\");\n \t\tassert.deepEqual([...calls[0]!.body], [0x89, 0x50, 0x4e, 0x47, 1, 2, 3]);\n \t\tconst opened = JSON.parse(calls[2]!.body.toString()) as { title: string; attachments: string[] };\n@@ -318,6 +321,17 @@\n \t\t\t/attached a0123456789ab: \"shot.png\", 2 KB, https:\\/\\/issues.example\\/p\\/x\\/attachments\\/a0123456789ab/,\n \t\t);\n \t\tassert.match(text, /\\n {4}attached a00000000000f: \"mine.png\", 3.0 MB/);\n+\t\t// The way in comes before the first link, since an agent's fetch of a link is refused.\n+\t\tassert.match(\n+\t\t\ttext,\n+\t\t\t/^Issue [^\\n]*\\n[^\\n]*\\n3 files are attached below\\. To read them: abso issue \\d+ --save-attachments <folder> saves every one there, then open the files\\. The links are for people signed in on the website\\.\\n/,\n+\t\t);\n+\t\tassert.doesNotMatch(\n+\t\t\tissuePage({ ...page, issue: { ...page.issue, attachments: [] }, comments: [] } as unknown as IssuePage).join(\n+\t\t\t\t\"\\n\",\n+\t\t\t),\n+\t\t\t/--save-attachments/,\n+\t\t);\n \t\t// An SVG is listed as its PNG, with its own file as a download beside it.\n \t\tassert.match(\n \t\t\ttext,\n@@ -348,6 +362,7 @@\n \t\t\t],\n \t\t} as unknown as IssuePage;\n \t\tconst asks = issuePage(asked, { attachmentUrl: (id: string) => `https://i.example/${id}` }).join(\"\\n\");\n+\t\tassert.match(asks, /\\n5 files are attached below\\./, \"an ask's question and answer files count too\");\n \t\tassert.match(\n \t\t\tasks,\n \t\t\t/ask 4: .*\"Which\\?\"\\n {4}attached a00000000000d: \"a.png\", 1 KB, https:\\/\\/i.example\\/a00000000000d\\n {4}answer: \"This\"\\n {6}attached a00000000000e: \"b.png\", 1 KB/,"}],"unmatched":[]}