Versions 25 to 318
Lines 3–9 at 318 (were 3–9 at 25)
44
6−import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
Lines 43–94 at 318 (were 43–51 at 25)
55+ return json({ ask: { by: "bob", answer: { by: "ann", words: "w", at: 0, attachments: files } } });
66+ answer: { attachments: [{ id: "a00000000000e", name: "answer.png", type: "image/png", size: 13 }] },
72+ // Issue 8 carries an svg-drawn image on itself and again on a comment, plus one more on the comment.
77+ comments: [{ attachments: [logo, { id: "a00000000000c", name: "after.png", type: "image/png", size: 13 }] }],
85+ return res.writeHead(200, { "content-type": "image/png" }).end(`${served[1]}${served[2] ?? ""}`);
89+ // As fake-server.ts: never close an idle kept-alive connection, or under load the client can reuse one as it closes
Lines 136–142 at 318 (were 93–99 at 25)
96− assert.equal(calls[0]!.headers["x-avcs-name"], "shot.png");
99142 const opened = JSON.parse(calls[2]!.body.toString()) as { title: string; attachments: string[] };
Lines 185–272 at 318 (were 142–147 at 25)
144187
188+ it("--save-attachments saves each attachment once, an svg's own file too, outside the folder", async () => {
195+ assert.deepEqual(names, ["a00000000000b-logo.svg", "a00000000000b-shot_one.png", "a00000000000c-after.png"]);
196+ assert.equal(readFileSync(join(out, "images", "a00000000000b-logo.svg"), "utf8"), "a00000000000b/source");
197+ assert.equal(readFileSync(join(out, "images", "a00000000000c-after.png"), "utf8"), "a00000000000c");
210+
228+ const ask = JSON.parse(seen.at(-1)!.body.toString()) as { question: string; attachments: string[] };
235+ const answer = JSON.parse(seen.at(-1)!.body.toString()) as { words: string; attachments: string[] };
244+
248+ const init = await avcs(dir, ["init", "--server", fake.url, "--project", "keepless", "--agent", "ann"]);
260+
267+ assert.deepEqual(readdirSync(out).sort(), ["a00000000000d-question.png", "a00000000000e-answer.png"]);
269+
Lines 321–371 at 318 (were 196–205 at 25)
196321 /attached a0123456789ab: "shot.png", 2 KB, https:\/\/issues.example\/p\/x\/attachments\/a0123456789ab/,
327+ /^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/,
330+ issuePage({ ...page, issue: { ...page.issue, attachments: [] }, comments: [] } as unknown as IssuePage).join(
202338 /\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/,
364+ const asks = issuePage(asked, { attachmentUrl: (id: string) => `https://i.example/${id}` }).join("\n");
365+ assert.match(asks, /\n5 files are attached below\./, "an ask's question and answer files count too");
368+ /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/,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 25 318 client/test/attach.test.ts --json
- JSON
- /christopher/abso-core/compare/25..318?file=client%2Ftest%2Fattach.test.ts&format=json