{"file":"client/test/attach.test.ts","version":318,"total":371,"from":1,"to":371,"lines":[{"n":1,"text":"// --attach (abso issue 171): images go up to the Issues Worker before the","atom":"a28","author":"pinch","version":5},{"n":2,"text":"// write that carries them, and the issue's page lists them. The Issues server","atom":"a28","author":"pinch","version":5},{"n":3,"text":"// here is a stand-in that keeps what it was sent.","atom":"a28","author":"pinch","version":5},{"n":4,"text":"","atom":"a28","author":"pinch","version":5},{"n":5,"text":"import assert from \"node:assert/strict\";","atom":"a28","author":"pinch","version":5},{"n":6,"text":"import { mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";","atom":"a227","author":"pinch","version":29},{"n":7,"text":"import { createServer, type Server } from \"node:http\";","atom":"a28","author":"pinch","version":5},{"n":8,"text":"import type { AddressInfo } from \"node:net\";","atom":"a28","author":"pinch","version":5},{"n":9,"text":"import { tmpdir } from \"node:os\";","atom":"a28","author":"pinch","version":5},{"n":10,"text":"import { join } from \"node:path\";","atom":"a28","author":"pinch","version":5},{"n":11,"text":"import { after, before, describe, it } from \"node:test\";","atom":"a28","author":"pinch","version":5},{"n":12,"text":"import { issuePage } from \"../src/issues.ts\";","atom":"a28","author":"pinch","version":5},{"n":13,"text":"import type { IssuePage } from \"../src/issues-wire.ts\";","atom":"a28","author":"pinch","version":5},{"n":14,"text":"import { main } from \"../src/main.ts\";","atom":"a28","author":"pinch","version":5},{"n":15,"text":"import { type Fake, startFake } from \"./fake-server.ts\";","atom":"a28","author":"pinch","version":5},{"n":16,"text":"","atom":"a28","author":"pinch","version":5},{"n":17,"text":"const TOKEN = \"test-token-not-secret\";","atom":"a28","author":"pinch","version":5},{"n":18,"text":"let fake: Fake;","atom":"a28","author":"pinch","version":5},{"n":19,"text":"let issues: Server;","atom":"a28","author":"pinch","version":5},{"n":20,"text":"let issuesUrl: string;","atom":"a28","author":"pinch","version":5},{"n":21,"text":"const seen: { method: string; url: string; headers: Record<string, string | string[] | undefined>; body: Buffer }[] =","atom":"a28","author":"pinch","version":5},{"n":22,"text":"\t[];","atom":"a28","author":"pinch","version":5},{"n":23,"text":"const dirs: string[] = [];","atom":"a28","author":"pinch","version":5},{"n":24,"text":"","atom":"a28","author":"pinch","version":5},{"n":25,"text":"before(async () => {","atom":"a28","author":"pinch","version":5},{"n":26,"text":"\tfake = await startFake(0, TOKEN);","atom":"a28","author":"pinch","version":5},{"n":27,"text":"\tissues = createServer((req, res) => {","atom":"a28","author":"pinch","version":5},{"n":28,"text":"\t\tconst parts: Buffer[] = [];","atom":"a28","author":"pinch","version":5},{"n":29,"text":"\t\treq.on(\"data\", (c: Buffer) => parts.push(c));","atom":"a28","author":"pinch","version":5},{"n":30,"text":"\t\treq.on(\"end\", () => {","atom":"a28","author":"pinch","version":5},{"n":31,"text":"\t\t\tconst body = Buffer.concat(parts);","atom":"a28","author":"pinch","version":5},{"n":32,"text":"\t\t\tseen.push({ method: req.method!, url: req.url!, headers: req.headers, body });","atom":"a28","author":"pinch","version":5},{"n":33,"text":"\t\t\tconst json = (o: unknown) => res.writeHead(200, { \"content-type\": \"application/json\" }).end(JSON.stringify(o));","atom":"a28","author":"pinch","version":5},{"n":34,"text":"\t\t\t// A server from before attachments: it reads every POST body as JSON.","atom":"a72","author":"pinch","version":15},{"n":35,"text":"\t\t\tif (req.url!.includes(\"/p/old\") && req.url!.endsWith(\"/attachments\"))","atom":"a72","author":"pinch","version":15},{"n":36,"text":"\t\t\t\treturn res.writeHead(400, { \"content-type\": \"application/json\" }).end('{\"error\":\"the body is JSON\"}');","atom":"a72","author":"pinch","version":15},{"n":37,"text":"\t\t\tif (req.url!.endsWith(\"/attachments\"))","atom":"a28","author":"pinch","version":5},{"n":38,"text":"\t\t\t\treturn json({","atom":"a28","author":"pinch","version":5},{"n":39,"text":"\t\t\t\t\tid: `a${String(seen.length).padStart(12, \"0\")}`,","atom":"a28","author":"pinch","version":5},{"n":40,"text":"\t\t\t\t\tname: \"x\",","atom":"a28","author":"pinch","version":5},{"n":41,"text":"\t\t\t\t\ttype: \"image/png\",","atom":"a28","author":"pinch","version":5},{"n":42,"text":"\t\t\t\t\tsize: body.length,","atom":"a28","author":"pinch","version":5},{"n":43,"text":"\t\t\t\t});","atom":"a28","author":"pinch","version":5},{"n":44,"text":"\t\t\tif (req.url!.endsWith(\"/issue\")) return json({ id: 7 });","atom":"a28","author":"pinch","version":5},{"n":45,"text":"\t\t\tif (/\\/issue\\/\\d+\\/comment$/.test(req.url!)) return json({ id: 3 });","atom":"a28","author":"pinch","version":5},{"n":46,"text":"\t\t\t// An older Issues server keeps no files on asks: it answers without them (project \"keepless\").","atom":"a301","author":"pinch","version":35},{"n":47,"text":"\t\t\tconst older = req.url!.includes(\"/p/keepless/\");","atom":"a301","author":"pinch","version":35},{"n":48,"text":"\t\t\tif (req.url!.endsWith(\"/ask\")) {","atom":"a296","author":"pinch","version":35},{"n":49,"text":"\t\t\t\tconst sent = (JSON.parse(body.toString()) as { attachments?: string[] }).attachments;","atom":"a296","author":"pinch","version":35},{"n":50,"text":"\t\t\t\treturn json({ id: 9, ...(sent && !older ? { attachments: sent } : {}) });","atom":"a296","author":"pinch","version":35},{"n":51,"text":"\t\t\t}","atom":"a296","author":"pinch","version":35},{"n":52,"text":"\t\t\tif (/\\/answer\\/\\d+$/.test(req.url!)) {","atom":"a296","author":"pinch","version":35},{"n":53,"text":"\t\t\t\tconst sent = (JSON.parse(body.toString()) as { attachments?: string[] }).attachments ?? [];","atom":"a296","author":"pinch","version":35},{"n":54,"text":"\t\t\t\tconst files = older ? [] : sent.map((id) => ({ id, name: \"x\", type: \"image/png\", size: 1 }));","atom":"a296","author":"pinch","version":35},{"n":55,"text":"\t\t\t\treturn json({ ask: { by: \"bob\", answer: { by: \"ann\", words: \"w\", at: 0, attachments: files } } });","atom":"a296","author":"pinch","version":35},{"n":56,"text":"\t\t\t}","atom":"a296","author":"pinch","version":35},{"n":57,"text":"\t\t\t// Issue 9's ask carries a file on its question and one on its answer.","atom":"a296","author":"pinch","version":35},{"n":58,"text":"\t\t\tif (req.method === \"GET\" && /\\/issue\\/9$/.test(req.url!))","atom":"a296","author":"pinch","version":35},{"n":59,"text":"\t\t\t\treturn json({","atom":"a296","author":"pinch","version":35},{"n":60,"text":"\t\t\t\t\tissue: { id: 9 },","atom":"a296","author":"pinch","version":35},{"n":61,"text":"\t\t\t\t\tcomments: [],","atom":"a296","author":"pinch","version":35},{"n":62,"text":"\t\t\t\t\tedits: [],","atom":"a296","author":"pinch","version":35},{"n":63,"text":"\t\t\t\t\tasks: [","atom":"a296","author":"pinch","version":35},{"n":64,"text":"\t\t\t\t\t\t{","atom":"a296","author":"pinch","version":35},{"n":65,"text":"\t\t\t\t\t\t\tattachments: [{ id: \"a00000000000d\", name: \"question.png\", type: \"image/png\", size: 13 }],","atom":"a296","author":"pinch","version":35},{"n":66,"text":"\t\t\t\t\t\t\tanswer: { attachments: [{ id: \"a00000000000e\", name: \"answer.png\", type: \"image/png\", size: 13 }] },","atom":"a296","author":"pinch","version":35},{"n":67,"text":"\t\t\t\t\t\t},","atom":"a296","author":"pinch","version":35},{"n":68,"text":"\t\t\t\t\t],","atom":"a296","author":"pinch","version":35},{"n":69,"text":"\t\t\t\t\tclaims: [],","atom":"a296","author":"pinch","version":35},{"n":70,"text":"\t\t\t\t\tchildren: [],","atom":"a296","author":"pinch","version":35},{"n":71,"text":"\t\t\t\t});","atom":"a296","author":"pinch","version":35},{"n":72,"text":"\t\t\t// Issue 8 carries an svg-drawn image on itself and again on a comment, plus one more on the comment.","atom":"a227","author":"pinch","version":29},{"n":73,"text":"\t\t\tconst logo = { id: \"a00000000000b\", name: \"../shot one.png\", type: \"image/png\", size: 13 };","atom":"a227","author":"pinch","version":29},{"n":74,"text":"\t\t\tif (req.method === \"GET\" && /\\/issue\\/8$/.test(req.url!))","atom":"a227","author":"pinch","version":29},{"n":75,"text":"\t\t\t\treturn json({","atom":"a227","author":"pinch","version":29},{"n":76,"text":"\t\t\t\t\tissue: { id: 8, attachments: [{ ...logo, source: { name: \"logo.svg\", size: 20 } }] },","atom":"a227","author":"pinch","version":29},{"n":77,"text":"\t\t\t\t\tcomments: [{ attachments: [logo, { id: \"a00000000000c\", name: \"after.png\", type: \"image/png\", size: 13 }] }],","atom":"a227","author":"pinch","version":29},{"n":78,"text":"\t\t\t\t\tedits: [],","atom":"a227","author":"pinch","version":29},{"n":79,"text":"\t\t\t\t\tasks: [],","atom":"a227","author":"pinch","version":29},{"n":80,"text":"\t\t\t\t\tclaims: [],","atom":"a227","author":"pinch","version":29},{"n":81,"text":"\t\t\t\t\tchildren: [],","atom":"a227","author":"pinch","version":29},{"n":82,"text":"\t\t\t\t});","atom":"a227","author":"pinch","version":29},{"n":83,"text":"\t\t\tconst served = /\\/attachments\\/(a[0-9a-f]{12})(\\/source)?$/.exec(req.url!);","atom":"a227","author":"pinch","version":29},{"n":84,"text":"\t\t\tif (req.method === \"GET\" && served)","atom":"a227","author":"pinch","version":29},{"n":85,"text":"\t\t\t\treturn res.writeHead(200, { \"content-type\": \"image/png\" }).end(`${served[1]}${served[2] ?? \"\"}`);","atom":"a227","author":"pinch","version":29},{"n":86,"text":"\t\t\tres.writeHead(404).end(\"{}\");","atom":"a28","author":"pinch","version":5},{"n":87,"text":"\t\t});","atom":"a28","author":"pinch","version":5},{"n":88,"text":"\t});","atom":"a28","author":"pinch","version":5},{"n":89,"text":"\t// As fake-server.ts: never close an idle kept-alive connection, or under load the client can reuse one as it closes","atom":"a822","author":"infra-pipeline","version":99},{"n":90,"text":"\t// and fail with ECONNRESET (abso 410).","atom":"a822","author":"infra-pipeline","version":99},{"n":91,"text":"\tissues.keepAliveTimeout = 0;","atom":"a822","author":"infra-pipeline","version":99},{"n":92,"text":"\tawait new Promise<void>((ok) => issues.listen(0, \"127.0.0.1\", ok));","atom":"a28","author":"pinch","version":5},{"n":93,"text":"\tissuesUrl = `http://127.0.0.1:${(issues.address() as AddressInfo).port}`;","atom":"a28","author":"pinch","version":5},{"n":94,"text":"});","atom":"a28","author":"pinch","version":5},{"n":95,"text":"after(async () => {","atom":"a28","author":"pinch","version":5},{"n":96,"text":"\tawait fake.close();","atom":"a28","author":"pinch","version":5},{"n":97,"text":"\tawait new Promise((ok) => issues.close(ok));","atom":"a28","author":"pinch","version":5},{"n":98,"text":"\tfor (const d of dirs) rmSync(d, { recursive: true, force: true, maxRetries: 5 });","atom":"a28","author":"pinch","version":5},{"n":99,"text":"});","atom":"a28","author":"pinch","version":5},{"n":100,"text":"","atom":"a28","author":"pinch","version":5},{"n":101,"text":"const ENV = (): Record<string, string> => ({","atom":"a28","author":"pinch","version":5},{"n":102,"text":"\tAVCS_TOKEN: TOKEN,","atom":"a28","author":"pinch","version":5},{"n":103,"text":"\tAVCS_HOOK_FORCE: \"1\",","atom":"a28","author":"pinch","version":5},{"n":104,"text":"\tAVCS_ISSUES_SERVER: issuesUrl,","atom":"a28","author":"pinch","version":5},{"n":105,"text":"\tAVCS_SERVERS_FILE: \"no-servers.json\",","atom":"a28","author":"pinch","version":5},{"n":106,"text":"});","atom":"a28","author":"pinch","version":5},{"n":107,"text":"","atom":"a28","author":"pinch","version":5},{"n":108,"text":"async function avcs(cwd: string, argv: string[]): Promise<{ exit: number; out: string; json?: unknown }> {","atom":"a28","author":"pinch","version":5},{"n":109,"text":"\tconst r = await main([...argv, \"--json\"], { cwd, env: ENV(), write: () => {} });","atom":"a28","author":"pinch","version":5},{"n":110,"text":"\tlet json: unknown;","atom":"a28","author":"pinch","version":5},{"n":111,"text":"\ttry {","atom":"a28","author":"pinch","version":5},{"n":112,"text":"\t\tjson = JSON.parse(r.stdout);","atom":"a28","author":"pinch","version":5},{"n":113,"text":"\t} catch {}","atom":"a28","author":"pinch","version":5},{"n":114,"text":"\treturn { exit: r.exit, out: r.stdout + r.stderr, json };","atom":"a28","author":"pinch","version":5},{"n":115,"text":"}","atom":"a28","author":"pinch","version":5},{"n":116,"text":"","atom":"a28","author":"pinch","version":5},{"n":117,"text":"let n = 0;","atom":"a28","author":"pinch","version":5},{"n":118,"text":"async function folder(): Promise<string> {","atom":"a28","author":"pinch","version":5},{"n":119,"text":"\tconst dir = mkdtempSync(join(tmpdir(), \"abso-attach-\"));","atom":"a28","author":"pinch","version":5},{"n":120,"text":"\tdirs.push(dir);","atom":"a28","author":"pinch","version":5},{"n":121,"text":"\tconst r = await avcs(dir, [\"init\", \"--server\", fake.url, \"--project\", `attach${++n}`, \"--agent\", \"ann\"]);","atom":"a28","author":"pinch","version":5},{"n":122,"text":"\tassert.equal(r.exit, 0, r.out);","atom":"a28","author":"pinch","version":5},{"n":123,"text":"\twriteFileSync(join(dir, \"shot.png\"), Buffer.from([0x89, 0x50, 0x4e, 0x47, 1, 2, 3]));","atom":"a28","author":"pinch","version":5},{"n":124,"text":"\twriteFileSync(join(dir, \"after.png\"), Buffer.from([0x89, 0x50, 0x4e, 0x47, 4, 5]));","atom":"a28","author":"pinch","version":5},{"n":125,"text":"\treturn dir;","atom":"a28","author":"pinch","version":5},{"n":126,"text":"}","atom":"a28","author":"pinch","version":5},{"n":127,"text":"","atom":"a28","author":"pinch","version":5},{"n":128,"text":"describe(\"--attach (abso issue 171)\", () => {","atom":"a28","author":"pinch","version":5},{"n":129,"text":"\tit(\"uploads each file, then opens the issue carrying their ids\", async () => {","atom":"a28","author":"pinch","version":5},{"n":130,"text":"\t\tconst dir = await folder();","atom":"a28","author":"pinch","version":5},{"n":131,"text":"\t\tconst from = seen.length;","atom":"a28","author":"pinch","version":5},{"n":132,"text":"\t\tconst r = await avcs(dir, [\"issue\", \"new\", \"The page after the fix\", \"--attach\", \"shot.png,after.png\"]);","atom":"a28","author":"pinch","version":5},{"n":133,"text":"\t\tassert.equal(r.exit, 0, r.out);","atom":"a28","author":"pinch","version":5},{"n":134,"text":"\t\tconst calls = seen.slice(from);","atom":"a28","author":"pinch","version":5},{"n":135,"text":"\t\tassert.deepEqual(","atom":"a28","author":"pinch","version":5},{"n":136,"text":"\t\t\tcalls.map((c) => `${c.method} ${c.url.replace(/^\\/p\\/[^/]+/, \"\")}`),","atom":"a28","author":"pinch","version":5},{"n":137,"text":"\t\t\t[\"POST /a/ann/attachments\", \"POST /a/ann/attachments\", \"POST /a/ann/issue\"],","atom":"a28","author":"pinch","version":5},{"n":138,"text":"\t\t);","atom":"a28","author":"pinch","version":5},{"n":139,"text":"\t\tassert.equal(calls[0]!.headers[\"x-abso-name\"], \"shot.png\");","atom":"a497","author":"pinch","version":54},{"n":140,"text":"\t\tassert.equal(calls[0]!.headers[\"content-type\"], \"application/octet-stream\");","atom":"a28","author":"pinch","version":5},{"n":141,"text":"\t\tassert.deepEqual([...calls[0]!.body], [0x89, 0x50, 0x4e, 0x47, 1, 2, 3]);","atom":"a28","author":"pinch","version":5},{"n":142,"text":"\t\tconst opened = JSON.parse(calls[2]!.body.toString()) as { title: string; attachments: string[] };","atom":"a28","author":"pinch","version":5},{"n":143,"text":"\t\tassert.equal(opened.title, \"The page after the fix\");","atom":"a28","author":"pinch","version":5},{"n":144,"text":"\t\tassert.equal(opened.attachments.length, 2);","atom":"a28","author":"pinch","version":5},{"n":145,"text":"\t\tassert.deepEqual((r.json as { attachments: string[] }).attachments, opened.attachments);","atom":"a28","author":"pinch","version":5},{"n":146,"text":"\t});","atom":"a28","author":"pinch","version":5},{"n":147,"text":"","atom":"a28","author":"pinch","version":5},{"n":148,"text":"\tit(\"goes on a comment too, and nowhere else\", async () => {","atom":"a28","author":"pinch","version":5},{"n":149,"text":"\t\tconst dir = await folder();","atom":"a28","author":"pinch","version":5},{"n":150,"text":"\t\tconst from = seen.length;","atom":"a28","author":"pinch","version":5},{"n":151,"text":"\t\tconst r = await avcs(dir, [\"issue\", \"7\", \"--comment\", \"after\", \"--attach\", \"shot.png\"]);","atom":"a28","author":"pinch","version":5},{"n":152,"text":"\t\tassert.equal(r.exit, 0, r.out);","atom":"a28","author":"pinch","version":5},{"n":153,"text":"\t\tconst comment = JSON.parse(seen.at(-1)!.body.toString()) as { text: string; attachments: string[] };","atom":"a28","author":"pinch","version":5},{"n":154,"text":"\t\tassert.equal(comment.text, \"after\");","atom":"a28","author":"pinch","version":5},{"n":155,"text":"\t\tassert.equal(comment.attachments.length, 1);","atom":"a28","author":"pinch","version":5},{"n":156,"text":"\t\tassert.equal(seen.length - from, 2);","atom":"a28","author":"pinch","version":5},{"n":157,"text":"\t\tconst alone = await avcs(dir, [\"issue\", \"7\", \"--attach\", \"shot.png\"]);","atom":"a28","author":"pinch","version":5},{"n":158,"text":"\t\tassert.equal(alone.exit, 1);","atom":"a28","author":"pinch","version":5},{"n":159,"text":"\t\tassert.match(alone.out, /--attach goes with abso issue new or --comment/);","atom":"a86","author":"review","version":16},{"n":160,"text":"\t});","atom":"a28","author":"pinch","version":5},{"n":161,"text":"","atom":"a73","author":"pinch","version":15},{"n":162,"text":"\tit(\"says plainly when the server doesn't take attachments yet, and writes nothing\", async () => {","atom":"a73","author":"pinch","version":15},{"n":163,"text":"\t\tconst dir = mkdtempSync(join(tmpdir(), \"abso-attach-\"));","atom":"a73","author":"pinch","version":15},{"n":164,"text":"\t\tdirs.push(dir);","atom":"a73","author":"pinch","version":15},{"n":165,"text":"\t\tconst init = await avcs(dir, [\"init\", \"--server\", fake.url, \"--project\", \"old\", \"--agent\", \"ann\"]);","atom":"a73","author":"pinch","version":15},{"n":166,"text":"\t\tassert.equal(init.exit, 0, init.out);","atom":"a73","author":"pinch","version":15},{"n":167,"text":"\t\twriteFileSync(join(dir, \"shot.png\"), Buffer.from([0x89, 0x50, 0x4e, 0x47, 1]));","atom":"a73","author":"pinch","version":15},{"n":168,"text":"\t\tconst from = seen.length;","atom":"a73","author":"pinch","version":15},{"n":169,"text":"\t\tconst r = await avcs(dir, [\"issue\", \"new\", \"T\", \"--attach\", \"shot.png\"]);","atom":"a73","author":"pinch","version":15},{"n":170,"text":"\t\tassert.equal(r.exit, 1);","atom":"a73","author":"pinch","version":15},{"n":171,"text":"\t\tassert.match(r.out, /doesn't take attachments yet, so shot.png wasn't sent and nothing was written/);","atom":"a73","author":"pinch","version":15},{"n":172,"text":"\t\tassert.deepEqual(","atom":"a73","author":"pinch","version":15},{"n":173,"text":"\t\t\tseen.slice(from).map((c) => c.url.replace(/^\\/p\\/[^/]+/, \"\")),","atom":"a73","author":"pinch","version":15},{"n":174,"text":"\t\t\t[\"/a/ann/attachments\"],","atom":"a73","author":"pinch","version":15},{"n":175,"text":"\t\t\t\"no issue was opened\",","atom":"a73","author":"pinch","version":15},{"n":176,"text":"\t\t);","atom":"a73","author":"pinch","version":15},{"n":177,"text":"\t});","atom":"a73","author":"pinch","version":15},{"n":178,"text":"","atom":"a28","author":"pinch","version":5},{"n":179,"text":"\tit(\"sends nothing when a file is missing\", async () => {","atom":"a28","author":"pinch","version":5},{"n":180,"text":"\t\tconst dir = await folder();","atom":"a28","author":"pinch","version":5},{"n":181,"text":"\t\tconst from = seen.length;","atom":"a28","author":"pinch","version":5},{"n":182,"text":"\t\tconst r = await avcs(dir, [\"issue\", \"new\", \"T\", \"--attach\", \"shot.png,nope.png\"]);","atom":"a28","author":"pinch","version":5},{"n":183,"text":"\t\tassert.equal(r.exit, 1);","atom":"a28","author":"pinch","version":5},{"n":184,"text":"\t\tassert.match(r.out, /--attach nope.png: no such file/);","atom":"a28","author":"pinch","version":5},{"n":185,"text":"\t\tassert.equal(seen.length, from);","atom":"a28","author":"pinch","version":5},{"n":186,"text":"\t});","atom":"a227","author":"pinch","version":29},{"n":187,"text":"","atom":"a227","author":"pinch","version":29},{"n":188,"text":"\tit(\"--save-attachments saves each attachment once, an svg's own file too, outside the folder\", async () => {","atom":"a227","author":"pinch","version":29},{"n":189,"text":"\t\tconst dir = await folder();","atom":"a227","author":"pinch","version":29},{"n":190,"text":"\t\tconst out = mkdtempSync(join(tmpdir(), \"abso-saved-\"));","atom":"a227","author":"pinch","version":29},{"n":191,"text":"\t\tdirs.push(out);","atom":"a227","author":"pinch","version":29},{"n":192,"text":"\t\tconst r = await avcs(dir, [\"issue\", \"8\", \"--save-attachments\", join(out, \"images\")]);","atom":"a227","author":"pinch","version":29},{"n":193,"text":"\t\tassert.equal(r.exit, 0, r.out);","atom":"a227","author":"pinch","version":29},{"n":194,"text":"\t\tconst names = readdirSync(join(out, \"images\")).sort();","atom":"a227","author":"pinch","version":29},{"n":195,"text":"\t\tassert.deepEqual(names, [\"a00000000000b-logo.svg\", \"a00000000000b-shot_one.png\", \"a00000000000c-after.png\"]);","atom":"a227","author":"pinch","version":29},{"n":196,"text":"\t\tassert.equal(readFileSync(join(out, \"images\", \"a00000000000b-logo.svg\"), \"utf8\"), \"a00000000000b/source\");","atom":"a227","author":"pinch","version":29},{"n":197,"text":"\t\tassert.equal(readFileSync(join(out, \"images\", \"a00000000000c-after.png\"), \"utf8\"), \"a00000000000c\");","atom":"a227","author":"pinch","version":29},{"n":198,"text":"\t\tassert.equal((r.json as { files: unknown[] }).files.length, 3);","atom":"a227","author":"pinch","version":29},{"n":199,"text":"\t\t// Into the folder only where abso leaves files out, or they'd be recorded as edits.","atom":"a227","author":"pinch","version":29},{"n":200,"text":"\t\tconst inside = await avcs(dir, [\"issue\", \"8\", \"--save-attachments\", \"images\"]);","atom":"a227","author":"pinch","version":29},{"n":201,"text":"\t\tassert.equal(inside.exit, 1);","atom":"a227","author":"pinch","version":29},{"n":202,"text":"\t\tassert.match(inside.out, /inside this abso folder/);","atom":"a227","author":"pinch","version":29},{"n":203,"text":"\t\tassert.equal((await avcs(dir, [\"issue\", \"8\", \"--save-attachments\", \".\"])).exit, 1);","atom":"a227","author":"pinch","version":29},{"n":204,"text":"\t\twriteFileSync(join(dir, \".absoignore\"), \"saved/\\n\");","atom":"a227","author":"pinch","version":29},{"n":205,"text":"\t\tassert.equal((await avcs(dir, [\"issue\", \"8\", \"--save-attachments\", \"saved\"])).exit, 0);","atom":"a227","author":"pinch","version":29},{"n":206,"text":"\t\tconst mixed = await avcs(dir, [\"issue\", \"8\", \"--save-attachments\", out, \"--comment\", \"x\"]);","atom":"a227","author":"pinch","version":29},{"n":207,"text":"\t\tassert.equal(mixed.exit, 1);","atom":"a227","author":"pinch","version":29},{"n":208,"text":"\t\tassert.match(mixed.out, /--save-attachments goes alone/);","atom":"a227","author":"pinch","version":29},{"n":209,"text":"\t});","atom":"a296","author":"pinch","version":35},{"n":210,"text":"","atom":"a296","author":"pinch","version":35},{"n":211,"text":"\tit(\"goes on an ask and on an answer, and not on a withdrawal\", async () => {","atom":"a296","author":"pinch","version":35},{"n":212,"text":"\t\tconst dir = await folder();","atom":"a296","author":"pinch","version":35},{"n":213,"text":"\t\tlet from = seen.length;","atom":"a296","author":"pinch","version":35},{"n":214,"text":"\t\tconst asked = await avcs(dir, [","atom":"a296","author":"pinch","version":35},{"n":215,"text":"\t\t\t\"ask\",","atom":"a296","author":"pinch","version":35},{"n":216,"text":"\t\t\t\"bob\",","atom":"a296","author":"pinch","version":35},{"n":217,"text":"\t\t\t\"Which looks right?\",","atom":"a296","author":"pinch","version":35},{"n":218,"text":"\t\t\t\"--issue\",","atom":"a296","author":"pinch","version":35},{"n":219,"text":"\t\t\t\"7\",","atom":"a296","author":"pinch","version":35},{"n":220,"text":"\t\t\t\"--attach\",","atom":"a296","author":"pinch","version":35},{"n":221,"text":"\t\t\t\"shot.png,after.png\",","atom":"a296","author":"pinch","version":35},{"n":222,"text":"\t\t]);","atom":"a296","author":"pinch","version":35},{"n":223,"text":"\t\tassert.equal(asked.exit, 0, asked.out);","atom":"a296","author":"pinch","version":35},{"n":224,"text":"\t\tassert.deepEqual(","atom":"a296","author":"pinch","version":35},{"n":225,"text":"\t\t\tseen.slice(from).map((c) => `${c.method} ${c.url.replace(/^\\/p\\/[^/]+/, \"\")}`),","atom":"a296","author":"pinch","version":35},{"n":226,"text":"\t\t\t[\"POST /a/ann/attachments\", \"POST /a/ann/attachments\", \"POST /a/ann/ask\"],","atom":"a296","author":"pinch","version":35},{"n":227,"text":"\t\t);","atom":"a296","author":"pinch","version":35},{"n":228,"text":"\t\tconst ask = JSON.parse(seen.at(-1)!.body.toString()) as { question: string; attachments: string[] };","atom":"a296","author":"pinch","version":35},{"n":229,"text":"\t\tassert.equal(ask.question, \"Which looks right?\");","atom":"a296","author":"pinch","version":35},{"n":230,"text":"\t\tassert.equal(ask.attachments.length, 2);","atom":"a296","author":"pinch","version":35},{"n":231,"text":"\t\tassert.deepEqual((asked.json as { attachments: string[] }).attachments, ask.attachments);","atom":"a296","author":"pinch","version":35},{"n":232,"text":"\t\tfrom = seen.length;","atom":"a296","author":"pinch","version":35},{"n":233,"text":"\t\tconst answered = await avcs(dir, [\"answer\", \"9\", \"This one\", \"--attach\", \"after.png\"]);","atom":"a296","author":"pinch","version":35},{"n":234,"text":"\t\tassert.equal(answered.exit, 0, answered.out);","atom":"a296","author":"pinch","version":35},{"n":235,"text":"\t\tconst answer = JSON.parse(seen.at(-1)!.body.toString()) as { words: string; attachments: string[] };","atom":"a296","author":"pinch","version":35},{"n":236,"text":"\t\tassert.equal(answer.words, \"This one\");","atom":"a296","author":"pinch","version":35},{"n":237,"text":"\t\tassert.equal(answer.attachments.length, 1);","atom":"a296","author":"pinch","version":35},{"n":238,"text":"\t\tassert.equal(seen.length - from, 2);","atom":"a296","author":"pinch","version":35},{"n":239,"text":"\t\tfrom = seen.length;","atom":"a296","author":"pinch","version":35},{"n":240,"text":"\t\tconst withdrawn = await avcs(dir, [\"ask\", \"--withdraw\", \"9\", \"--attach\", \"shot.png\"]);","atom":"a296","author":"pinch","version":35},{"n":241,"text":"\t\tassert.equal(withdrawn.exit, 1);","atom":"a296","author":"pinch","version":35},{"n":242,"text":"\t\tassert.equal(seen.length, from, \"nothing was sent\");","atom":"a296","author":"pinch","version":35},{"n":243,"text":"\t});","atom":"a296","author":"pinch","version":35},{"n":244,"text":"","atom":"a296","author":"pinch","version":35},{"n":245,"text":"\tit(\"says so when an older Issues server keeps an ask's words but not its files\", async () => {","atom":"a296","author":"pinch","version":35},{"n":246,"text":"\t\tconst dir = mkdtempSync(join(tmpdir(), \"abso-attach-\"));","atom":"a296","author":"pinch","version":35},{"n":247,"text":"\t\tdirs.push(dir);","atom":"a296","author":"pinch","version":35},{"n":248,"text":"\t\tconst init = await avcs(dir, [\"init\", \"--server\", fake.url, \"--project\", \"keepless\", \"--agent\", \"ann\"]);","atom":"a301","author":"pinch","version":35},{"n":249,"text":"\t\tassert.equal(init.exit, 0, init.out);","atom":"a296","author":"pinch","version":35},{"n":250,"text":"\t\twriteFileSync(join(dir, \"shot.png\"), Buffer.from([0x89, 0x50, 0x4e, 0x47, 1]));","atom":"a296","author":"pinch","version":35},{"n":251,"text":"\t\tconst asked = await avcs(dir, [\"ask\", \"bob\", \"Which?\", \"--attach\", \"shot.png\"]);","atom":"a296","author":"pinch","version":35},{"n":252,"text":"\t\tassert.equal(asked.exit, 0, asked.out);","atom":"a296","author":"pinch","version":35},{"n":253,"text":"\t\tassert.match(asked.out, /didn't keep the file on ask 9: it is older than this client/);","atom":"a296","author":"pinch","version":35},{"n":254,"text":"\t\tconst answered = await avcs(dir, [\"answer\", \"9\", \"This\", \"--attach\", \"shot.png\"]);","atom":"a296","author":"pinch","version":35},{"n":255,"text":"\t\tassert.match(answered.out, /didn't keep the file on your answer to ask 9/);","atom":"a296","author":"pinch","version":35},{"n":256,"text":"\t\t// A server that keeps them says nothing of the kind.","atom":"a296","author":"pinch","version":35},{"n":257,"text":"\t\tconst kept = await avcs(await folder(), [\"ask\", \"bob\", \"Which?\", \"--attach\", \"shot.png\"]);","atom":"a296","author":"pinch","version":35},{"n":258,"text":"\t\tassert.doesNotMatch(kept.out, /didn't keep/);","atom":"a296","author":"pinch","version":35},{"n":259,"text":"\t});","atom":"a296","author":"pinch","version":35},{"n":260,"text":"","atom":"a296","author":"pinch","version":35},{"n":261,"text":"\tit(\"--save-attachments takes the files on an issue's asks and answers too\", async () => {","atom":"a296","author":"pinch","version":35},{"n":262,"text":"\t\tconst dir = await folder();","atom":"a296","author":"pinch","version":35},{"n":263,"text":"\t\tconst out = mkdtempSync(join(tmpdir(), \"abso-saved-\"));","atom":"a296","author":"pinch","version":35},{"n":264,"text":"\t\tdirs.push(out);","atom":"a296","author":"pinch","version":35},{"n":265,"text":"\t\tconst r = await avcs(dir, [\"issue\", \"9\", \"--save-attachments\", out]);","atom":"a296","author":"pinch","version":35},{"n":266,"text":"\t\tassert.equal(r.exit, 0, r.out);","atom":"a296","author":"pinch","version":35},{"n":267,"text":"\t\tassert.deepEqual(readdirSync(out).sort(), [\"a00000000000d-question.png\", \"a00000000000e-answer.png\"]);","atom":"a296","author":"pinch","version":35},{"n":268,"text":"\t});","atom":"a28","author":"pinch","version":5},{"n":269,"text":"","atom":"a28","author":"pinch","version":5},{"n":270,"text":"\tit(\"an issue's page lists its attachments and each comment's, with links\", () => {","atom":"a28","author":"pinch","version":5},{"n":271,"text":"\t\tconst page = {","atom":"a28","author":"pinch","version":5},{"n":272,"text":"\t\t\tissue: {","atom":"a28","author":"pinch","version":5},{"n":273,"text":"\t\t\t\tid: 7,","atom":"a28","author":"pinch","version":5},{"n":274,"text":"\t\t\t\ttitle: \"T\",","atom":"a28","author":"pinch","version":5},{"n":275,"text":"\t\t\t\tstatus: \"open\",","atom":"a28","author":"pinch","version":5},{"n":276,"text":"\t\t\t\topened: { by: \"ann\", at: 0 },","atom":"a28","author":"pinch","version":5},{"n":277,"text":"\t\t\t\tagent: null,","atom":"a28","author":"pinch","version":5},{"n":278,"text":"\t\t\t\tagents: [],","atom":"a28","author":"pinch","version":5},{"n":279,"text":"\t\t\t\tblockedBy: [],","atom":"a28","author":"pinch","version":5},{"n":280,"text":"\t\t\t\tlabels: [],","atom":"a28","author":"pinch","version":5},{"n":281,"text":"\t\t\t\tversions: [],","atom":"a28","author":"pinch","version":5},{"n":282,"text":"\t\t\t\twaitingOn: [],","atom":"a28","author":"pinch","version":5},{"n":283,"text":"\t\t\t\tparent: null,","atom":"a28","author":"pinch","version":5},{"n":284,"text":"\t\t\t\tchildren: 0,","atom":"a28","author":"pinch","version":5},{"n":285,"text":"\t\t\t\tupdated: 0,","atom":"a28","author":"pinch","version":5},{"n":286,"text":"\t\t\t\tclosed: null,","atom":"a28","author":"pinch","version":5},{"n":287,"text":"\t\t\t\tdescription: \"\",","atom":"a28","author":"pinch","version":5},{"n":288,"text":"\t\t\t\tlines: null,","atom":"a28","author":"pinch","version":5},{"n":289,"text":"\t\t\t\twatchers: [],","atom":"a28","author":"pinch","version":5},{"n":290,"text":"\t\t\t\tattachments: [{ id: \"a0123456789ab\", name: \"shot.png\", type: \"image/png\", size: 2048 }],","atom":"a28","author":"pinch","version":5},{"n":291,"text":"\t\t\t},","atom":"a28","author":"pinch","version":5},{"n":292,"text":"\t\t\tcomments: [","atom":"a28","author":"pinch","version":5},{"n":293,"text":"\t\t\t\t{","atom":"a28","author":"pinch","version":5},{"n":294,"text":"\t\t\t\t\tid: 1,","atom":"a28","author":"pinch","version":5},{"n":295,"text":"\t\t\t\t\tby: \"bob\",","atom":"a28","author":"pinch","version":5},{"n":296,"text":"\t\t\t\t\tkind: \"comment\",","atom":"a28","author":"pinch","version":5},{"n":297,"text":"\t\t\t\t\ttext: \"same here\",","atom":"a28","author":"pinch","version":5},{"n":298,"text":"\t\t\t\t\tat: 0,","atom":"a28","author":"pinch","version":5},{"n":299,"text":"\t\t\t\t\tattachments: [","atom":"a171","author":"pinch","version":24},{"n":300,"text":"\t\t\t\t\t\t{ id: \"a00000000000f\", name: \"mine.png\", type: \"image/png\", size: 3 * 1024 * 1024 },","atom":"a171","author":"pinch","version":24},{"n":301,"text":"\t\t\t\t\t\t{","atom":"a171","author":"pinch","version":24},{"n":302,"text":"\t\t\t\t\t\t\tid: \"a0000000000aa\",","atom":"a171","author":"pinch","version":24},{"n":303,"text":"\t\t\t\t\t\t\tname: \"logo.png\",","atom":"a171","author":"pinch","version":24},{"n":304,"text":"\t\t\t\t\t\t\ttype: \"image/png\",","atom":"a171","author":"pinch","version":24},{"n":305,"text":"\t\t\t\t\t\t\tsize: 4096,","atom":"a171","author":"pinch","version":24},{"n":306,"text":"\t\t\t\t\t\t\tsource: { name: \"logo.svg\", size: 512 },","atom":"a171","author":"pinch","version":24},{"n":307,"text":"\t\t\t\t\t\t},","atom":"a171","author":"pinch","version":24},{"n":308,"text":"\t\t\t\t\t],","atom":"a171","author":"pinch","version":24},{"n":309,"text":"\t\t\t\t},","atom":"a28","author":"pinch","version":5},{"n":310,"text":"\t\t\t],","atom":"a28","author":"pinch","version":5},{"n":311,"text":"\t\t\tedits: [],","atom":"a28","author":"pinch","version":5},{"n":312,"text":"\t\t\tasks: [],","atom":"a28","author":"pinch","version":5},{"n":313,"text":"\t\t\tclaims: [],","atom":"a28","author":"pinch","version":5},{"n":314,"text":"\t\t\tchildren: [],","atom":"a28","author":"pinch","version":5},{"n":315,"text":"\t\t} as unknown as IssuePage;","atom":"a28","author":"pinch","version":5},{"n":316,"text":"\t\tconst text = issuePage(page, {","atom":"a28","author":"pinch","version":5},{"n":317,"text":"\t\t\tattachmentUrl: (id: string) => `https://issues.example/p/x/attachments/${id}`,","atom":"a28","author":"pinch","version":5},{"n":318,"text":"\t\t}).join(\"\\n\");","atom":"a28","author":"pinch","version":5},{"n":319,"text":"\t\tassert.match(","atom":"a28","author":"pinch","version":5},{"n":320,"text":"\t\t\ttext,","atom":"a28","author":"pinch","version":5},{"n":321,"text":"\t\t\t/attached a0123456789ab: \"shot.png\", 2 KB, https:\\/\\/issues.example\\/p\\/x\\/attachments\\/a0123456789ab/,","atom":"a28","author":"pinch","version":5},{"n":322,"text":"\t\t);","atom":"a28","author":"pinch","version":5},{"n":323,"text":"\t\tassert.match(text, /\\n {4}attached a00000000000f: \"mine.png\", 3.0 MB/);","atom":"a28","author":"pinch","version":5},{"n":324,"text":"\t\t// The way in comes before the first link, since an agent's fetch of a link is refused.","atom":"a449","author":"pinch","version":47},{"n":325,"text":"\t\tassert.match(","atom":"a449","author":"pinch","version":47},{"n":326,"text":"\t\t\ttext,","atom":"a449","author":"pinch","version":47},{"n":327,"text":"\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/,","atom":"a449","author":"pinch","version":47},{"n":328,"text":"\t\t);","atom":"a449","author":"pinch","version":47},{"n":329,"text":"\t\tassert.doesNotMatch(","atom":"a451","author":"pinch","version":47},{"n":330,"text":"\t\t\tissuePage({ ...page, issue: { ...page.issue, attachments: [] }, comments: [] } as unknown as IssuePage).join(","atom":"a451","author":"pinch","version":47},{"n":331,"text":"\t\t\t\t\"\\n\",","atom":"a451","author":"pinch","version":47},{"n":332,"text":"\t\t\t),","atom":"a451","author":"pinch","version":47},{"n":333,"text":"\t\t\t/--save-attachments/,","atom":"a451","author":"pinch","version":47},{"n":334,"text":"\t\t);","atom":"a451","author":"pinch","version":47},{"n":335,"text":"\t\t// An SVG is listed as its PNG, with its own file as a download beside it.","atom":"a171","author":"pinch","version":24},{"n":336,"text":"\t\tassert.match(","atom":"a171","author":"pinch","version":24},{"n":337,"text":"\t\t\ttext,","atom":"a171","author":"pinch","version":24},{"n":338,"text":"\t\t\t/\\n {4}attached a0000000000aa: \"logo.png\", 4 KB, \\S+\\/a0000000000aa\\n {6}drawn from \"logo.svg\", 512 B, https:\\/\\/issues.example\\/p\\/x\\/attachments\\/a0000000000aa\\/source/,","atom":"a171","author":"pinch","version":24},{"n":339,"text":"\t\t);","atom":"a171","author":"pinch","version":24},{"n":340,"text":"\t\t// An ask lists its question's files under it, and its answer's under the answer.","atom":"a295","author":"pinch","version":35},{"n":341,"text":"\t\tconst file = (id: string, name: string) => ({ id, name, type: \"image/png\", size: 1024 });","atom":"a295","author":"pinch","version":35},{"n":342,"text":"\t\tconst asked = {","atom":"a295","author":"pinch","version":35},{"n":343,"text":"\t\t\t...page,","atom":"a295","author":"pinch","version":35},{"n":344,"text":"\t\t\tasks: [","atom":"a295","author":"pinch","version":35},{"n":345,"text":"\t\t\t\t{","atom":"a295","author":"pinch","version":35},{"n":346,"text":"\t\t\t\t\tid: 4,","atom":"a295","author":"pinch","version":35},{"n":347,"text":"\t\t\t\t\tissue: 7,","atom":"a295","author":"pinch","version":35},{"n":348,"text":"\t\t\t\t\tby: \"ann\",","atom":"a295","author":"pinch","version":35},{"n":349,"text":"\t\t\t\t\tof: \"bob\",","atom":"a295","author":"pinch","version":35},{"n":350,"text":"\t\t\t\t\tkind: \"question\",","atom":"a295","author":"pinch","version":35},{"n":351,"text":"\t\t\t\t\tquestion: \"Which?\",","atom":"a295","author":"pinch","version":35},{"n":352,"text":"\t\t\t\t\tattachments: [file(\"a00000000000d\", \"a.png\")],","atom":"a295","author":"pinch","version":35},{"n":353,"text":"\t\t\t\t\treview: false,","atom":"a295","author":"pinch","version":35},{"n":354,"text":"\t\t\t\t\tdue: null,","atom":"a295","author":"pinch","version":35},{"n":355,"text":"\t\t\t\t\trecommendation: null,","atom":"a295","author":"pinch","version":35},{"n":356,"text":"\t\t\t\t\toptions: [],","atom":"a295","author":"pinch","version":35},{"n":357,"text":"\t\t\t\t\tblocks: [],","atom":"a295","author":"pinch","version":35},{"n":358,"text":"\t\t\t\t\tat: 0,","atom":"a295","author":"pinch","version":35},{"n":359,"text":"\t\t\t\t\tanswer: { by: \"bob\", words: \"This\", at: 0, attachments: [file(\"a00000000000e\", \"b.png\")] },","atom":"a295","author":"pinch","version":35},{"n":360,"text":"\t\t\t\t\tseen: null,","atom":"a295","author":"pinch","version":35},{"n":361,"text":"\t\t\t\t},","atom":"a295","author":"pinch","version":35},{"n":362,"text":"\t\t\t],","atom":"a295","author":"pinch","version":35},{"n":363,"text":"\t\t} as unknown as IssuePage;","atom":"a295","author":"pinch","version":35},{"n":364,"text":"\t\tconst asks = issuePage(asked, { attachmentUrl: (id: string) => `https://i.example/${id}` }).join(\"\\n\");","atom":"a295","author":"pinch","version":35},{"n":365,"text":"\t\tassert.match(asks, /\\n5 files are attached below\\./, \"an ask's question and answer files count too\");","atom":"a449","author":"pinch","version":47},{"n":366,"text":"\t\tassert.match(","atom":"a295","author":"pinch","version":35},{"n":367,"text":"\t\t\tasks,","atom":"a295","author":"pinch","version":35},{"n":368,"text":"\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/,","atom":"a295","author":"pinch","version":35},{"n":369,"text":"\t\t);","atom":"a295","author":"pinch","version":35},{"n":370,"text":"\t});","atom":"a28","author":"pinch","version":5},{"n":371,"text":"});","atom":"a28","author":"pinch","version":5}],"atoms":[{"atom":"a28","author":"pinch","message":"","time":1791510162333,"timeIso":"2026-10-09T01:42:42.333Z","publish":{"draft":null,"version":5,"agent":"pinch","message":"abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).","time":1791510167765,"timeIso":"2026-10-09T01:42:47.765Z"}},{"atom":"a72","author":"pinch","message":"","time":1791520639737,"timeIso":"2026-10-09T04:37:19.737Z","publish":{"draft":null,"version":15,"agent":"pinch","message":"--attach says plainly when the Issues server doesn't take attachments yet\n\nA server from before attachments has no upload route. It answered 400 'the body is JSON', or 404, and the client printed that as it came, which told nobody what had happened. Now the client says the server doesn't take attachments yet, that the file wasn't sent and nothing was written, and to leave --attach off or link the image instead. A server that has the route but nowhere to keep files (501) gets the same message. A test checks the message and that no issue is opened.","time":1791520723403,"timeIso":"2026-10-09T04:38:43.403Z"}},{"atom":"a73","author":"pinch","message":"","time":1791520639941,"timeIso":"2026-10-09T04:37:19.941Z","publish":{"draft":null,"version":15,"agent":"pinch","message":"--attach says plainly when the Issues server doesn't take attachments yet\n\nA server from before attachments has no upload route. It answered 400 'the body is JSON', or 404, and the client printed that as it came, which told nobody what had happened. Now the client says the server doesn't take attachments yet, that the file wasn't sent and nothing was written, and to leave --attach off or link the image instead. A server that has the route but nowhere to keep files (501) gets the same message. A test checks the message and that no issue is opened.","time":1791520723403,"timeIso":"2026-10-09T04:38:43.403Z"}},{"atom":"a86","author":"review","message":"","time":1791520995119,"timeIso":"2026-10-09T04:43:15.119Z","publish":{"draft":null,"version":16,"agent":"review","message":"The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).","time":1791521002669,"timeIso":"2026-10-09T04:43:22.669Z"}},{"atom":"a171","author":"pinch","message":"","time":1791530824018,"timeIso":"2026-10-09T07:27:04.018Z","publish":{"draft":null,"version":24,"agent":"pinch","message":"abso issue N lists an SVG attachment's own file. A server that takes SVG attachments draws each one as a PNG, and keeps the SVG only as a download. The issue page now shows that download under the image: 'drawn from \"logo.svg\", 512 B, <link>/source'. The --attach help says svg is taken, up to 1 MB, on servers that take it.","time":1791530831111,"timeIso":"2026-10-09T07:27:11.111Z"}},{"atom":"a227","author":"pinch","message":"","time":1791538058709,"timeIso":"2026-10-09T09:27:38.709Z","publish":{"draft":null,"version":29,"agent":"pinch","message":"Client: abso issue N --save-attachments <dir> saves each attachment on an issue and its comments once (an SVG's own file beside its drawing), outside the abso folder unless the place is ignored; MCP confines the folder like attach. abso export now stamps its folder with .abso-export, one line of JSON in a file with no extension, so the exported project's own formatter and linter pass it by; a folder stamped .abso-export.json or .avcs-export.json still counts as an export.","time":1791540340754,"timeIso":"2026-10-09T10:05:40.754Z"}},{"atom":"a295","author":"pinch","message":"","time":1791544151004,"timeIso":"2026-10-09T11:09:11.004Z","publish":{"draft":null,"version":35,"agent":"pinch","message":"Client: files on asks and answers. abso ask and abso answer take --attach (uploaded first, as on issues; not with --withdraw); an ask lists its question's files under it and its answer's under the answer; abso issue N --save-attachments takes them too. An Issues server from before asks carried files keeps the words and drops the files: abso says so (notKept in --json) instead of losing them quietly. Wire: Ask.attachments and answer.attachments, optional. Client tests 286/286, tsc and biome clean.","time":1791544592629,"timeIso":"2026-10-09T11:16:32.629Z"}},{"atom":"a296","author":"pinch","message":"","time":1791544247869,"timeIso":"2026-10-09T11:10:47.869Z","publish":{"draft":null,"version":35,"agent":"pinch","message":"Client: files on asks and answers. abso ask and abso answer take --attach (uploaded first, as on issues; not with --withdraw); an ask lists its question's files under it and its answer's under the answer; abso issue N --save-attachments takes them too. An Issues server from before asks carried files keeps the words and drops the files: abso says so (notKept in --json) instead of losing them quietly. Wire: Ask.attachments and answer.attachments, optional. Client tests 286/286, tsc and biome clean.","time":1791544592629,"timeIso":"2026-10-09T11:16:32.629Z"}},{"atom":"a301","author":"pinch","message":"","time":1791544558067,"timeIso":"2026-10-09T11:15:58.067Z","publish":{"draft":null,"version":35,"agent":"pinch","message":"Client: files on asks and answers. abso ask and abso answer take --attach (uploaded first, as on issues; not with --withdraw); an ask lists its question's files under it and its answer's under the answer; abso issue N --save-attachments takes them too. An Issues server from before asks carried files keeps the words and drops the files: abso says so (notKept in --json) instead of losing them quietly. Wire: Ask.attachments and answer.attachments, optional. Client tests 286/286, tsc and biome clean.","time":1791544592629,"timeIso":"2026-10-09T11:16:32.629Z"}},{"atom":"a449","author":"pinch","message":"","time":1791578852460,"timeIso":"2026-10-09T20:47:32.460Z","publish":{"draft":null,"version":47,"agent":"pinch","message":"abso issue: say how to read attached files before their links\n\nAn issue page lists each attachment with a link, but the link opens only for people signed in on the website; an agent that fetched it was refused and didn't know where else to look. When the issue, its comments, or its asks and answers carry files, the page now says so under the title, with the way in: \"3 files are attached below. To read them: abso issue 7 --save-attachments <folder> saves every one there, then open the files. The links are for people signed in on the website.\"\n\nThe abso skill gets the same as a line under \"Issues and asks\", in SKILL.md and in the copy the client carries. Tests in attach.test.ts cover the count across the issue, comments, questions and answers, and a page with no files saying nothing.","time":1791579053258,"timeIso":"2026-10-09T20:50:53.258Z"}},{"atom":"a451","author":"pinch","message":"","time":1791579052208,"timeIso":"2026-10-09T20:50:52.208Z","publish":{"draft":null,"version":47,"agent":"pinch","message":"abso issue: say how to read attached files before their links\n\nAn issue page lists each attachment with a link, but the link opens only for people signed in on the website; an agent that fetched it was refused and didn't know where else to look. When the issue, its comments, or its asks and answers carry files, the page now says so under the title, with the way in: \"3 files are attached below. To read them: abso issue 7 --save-attachments <folder> saves every one there, then open the files. The links are for people signed in on the website.\"\n\nThe abso skill gets the same as a line under \"Issues and asks\", in SKILL.md and in the copy the client carries. Tests in attach.test.ts cover the count across the issue, comments, questions and answers, and a page with no files saying nothing.","time":1791579053258,"timeIso":"2026-10-09T20:50:53.258Z"}},{"atom":"a497","author":"pinch","message":"","time":1791586659806,"timeIso":"2026-10-09T22:57:39.806Z","publish":{"draft":null,"version":54,"agent":"pinch","message":"The client and the edit mods send and read X-Abso-* headers only (Client, Name, Run-Key, Kind, Admin; Run, Box, Prep from answers). Servers have read X-Abso-* beside the old names for a while and answer under both, so this works with any current server.","time":1791586669845,"timeIso":"2026-10-09T22:57:49.845Z"}},{"atom":"a822","author":"infra-pipeline","message":"","time":1791650650965,"timeIso":"2026-10-10T16:44:10.965Z","publish":{"draft":null,"version":99,"agent":"infra-pipeline","message":"Test servers keep idle connections open (abso 410): issues.test.ts, attach.test.ts and client-version.test.ts set keepAliveTimeout = 0, as fake-server.ts already does. Under a full check's load, 'waiting --asked' took 6.3 s and its next call reused a kept-alive socket just as Node's default 5 s timeout closed it: ECONNRESET. Tests only.","time":1791650651433,"timeIso":"2026-10-10T16:44:11.433Z"}}]}