mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(desktop): preserve snapshot attachment URLs (#1905)
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
@@ -227,18 +227,23 @@ test("resolveSnapshotCard: uppercase .AGENT.JSON classifies as snapshot card", (
|
||||
|
||||
// ── snapshot card thumbnails ─────────────────────────────────────────────────
|
||||
|
||||
test("resolveSnapshotCard: .agent.png uses its own URL as thumb", () => {
|
||||
test("resolveSnapshotCard: keeps canonical PNG URL for actions", () => {
|
||||
const card = resolveSnapshotCard(
|
||||
{ m: "image/png", size: 2048, filename: "bot.agent.png", x: SHA256 },
|
||||
PNG_URL,
|
||||
"",
|
||||
);
|
||||
assert.ok(card !== null);
|
||||
// PNG attachment URL is rewritten by rewriteRelayUrl — just verify it's set
|
||||
assert.equal(card.href, PNG_URL);
|
||||
assert.ok(
|
||||
card.thumb != null,
|
||||
"PNG card must have a thumb set from its own URL",
|
||||
);
|
||||
assert.notEqual(
|
||||
card.thumb,
|
||||
card.href,
|
||||
"only the display thumbnail may use the local media proxy",
|
||||
);
|
||||
});
|
||||
|
||||
test("resolveSnapshotCard: .agent.json without thumb field yields undefined thumb", () => {
|
||||
|
||||
@@ -86,7 +86,7 @@ export function resolveSnapshotCard(
|
||||
const snapshotKind: "agent" | "team" = isJson || isPng ? "agent" : "team";
|
||||
|
||||
return {
|
||||
href: rewriteRelayUrl(href),
|
||||
href,
|
||||
filename,
|
||||
size: entry.size,
|
||||
sha256,
|
||||
|
||||
Reference in New Issue
Block a user