Remove cache mutation in unfurl (#13183)

This commit is contained in:
Tom Moor
2026-07-28 17:59:58 -04:00
committed by GitHub
parent 82419bbb0f
commit 71e9f1a5df
4 changed files with 3 additions and 23 deletions
-1
View File
@@ -168,7 +168,6 @@ export class Figma {
description: `Created by ${data.file.creator.handle}`,
thumbnailUrl: data.file.thumbnail_url,
faviconUrl: cdnPath("/images/figma.png"),
transformedUnfurl: true,
};
}
} catch (err) {
-1
View File
@@ -71,7 +71,6 @@ class Iframely {
parsedData.meta.site === "Figma"
? cdnPath("/images/figma.png")
: ((parsedData.links.icon ?? [])[0]?.href ?? ""),
transformedUnfurl: true,
};
};
}
+2 -18
View File
@@ -33,24 +33,8 @@ async function presentUnfurl(
}
}
const presentURL = (
data: UnfurlData
): UnfurlResponse[UnfurlResourceType.URL] => {
// TODO: For backwards compatibility, remove once cache has expired in next release.
if (data.transformedUnfurl) {
delete data.transformedUnfurl;
return data as UnfurlResponse[UnfurlResourceType.URL]; // this would have been transformed by the unfurl plugin.
}
return {
type: UnfurlResourceType.URL,
url: data.url,
title: data.meta.title,
description: data.meta.description,
thumbnailUrl: (data.links.thumbnail ?? [])[0]?.href ?? "",
faviconUrl: (data.links.icon ?? [])[0]?.href ?? "",
};
};
const presentURL = (data: UnfurlData): UnfurlResponse[UnfurlResourceType.URL] =>
data as UnfurlResponse[UnfurlResourceType.URL]; // this would have been transformed by the unfurl plugin.
const presentMention = async (
data: UnfurlData,
+1 -3
View File
@@ -596,9 +596,7 @@ export type UnfurlIssueOrPR =
export type UnfurlProject = UnfurlResponse[UnfurlResourceType.Project];
export type UnfurlURL = UnfurlResponse[UnfurlResourceType.URL] & {
transformedUnfurl: true;
};
export type UnfurlURL = UnfurlResponse[UnfurlResourceType.URL];
export type Unfurl =
| UnfurlIssueOrPR