Mirror — see github.com/blacksky-algorithms/blacksky.community
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix link card preview failures and web download timeout

Propagate errors from getLinkMeta through resolveExternal so React Query
treats failed CardyB fetches as errors instead of caching empty data as
a successful result for 1 hour. This ensures automatic retries and shows
error messages instead of blank grey previews.

Fix AbortController in web downloadAndResize - signal was created but
never passed to fetch(), making the timeout a no-op.

+13 -12
+6 -2
src/lib/api/resolve.ts
··· 1 1 import { 2 2 type AppBskyFeedDefs, 3 3 type AppBskyGraphDefs, 4 + type BskyAgent, 4 5 type ComAtprotoRepoStrongRef, 5 6 } from '@atproto/api' 6 7 import {AtUri} from '@atproto/api' 7 - import {type BskyAgent} from '@atproto/api' 8 8 9 9 import {POST_IMG_MAX} from '#/lib/constants' 10 10 import {getLinkMeta} from '#/lib/link-meta/link-meta' ··· 15 15 parseStarterPackUri, 16 16 } from '#/lib/strings/starter-pack' 17 17 import { 18 + convertBskyAppUrlIfNeeded, 18 19 isBskyCustomFeedUrl, 19 20 isBskyListUrl, 20 21 isBskyPostUrl, 21 22 isBskyStarterPackUrl, 22 23 isBskyStartUrl, 23 24 isShortLink, 25 + makeRecordUri, 24 26 } from '#/lib/strings/url-helpers' 25 27 import {type ComposerImage} from '#/state/gallery' 26 28 import {createComposerImage} from '#/state/gallery' 27 29 import {type Gif} from '#/state/queries/tenor' 28 30 import {createGIFDescription} from '../gif-alt-text' 29 - import {convertBskyAppUrlIfNeeded, makeRecordUri} from '../strings/url-helpers' 30 31 31 32 type ResolvedExternalLink = { 32 33 type: 'external' ··· 205 206 uri: string, 206 207 ): Promise<ResolvedExternalLink> { 207 208 const result = await getLinkMeta(agent, uri) 209 + if (result.error) { 210 + throw new Error(result.error) 211 + } 208 212 return { 209 213 type: 'external', 210 214 uri: result.url,
+1 -1
src/lib/media/manip.web.ts
··· 32 32 export async function downloadAndResize(opts: DownloadAndResizeOpts) { 33 33 const controller = new AbortController() 34 34 const to = setTimeout(() => controller.abort(), opts.timeout || 5e3) 35 - const res = await fetch(opts.uri) 35 + const res = await fetch(opts.uri, {signal: controller.signal}) 36 36 const resBody = await res.blob() 37 37 clearTimeout(to) 38 38
+1 -1
src/view/com/feeds/ComposerPrompt.tsx
··· 189 189 a.text_md, 190 190 {includeFontPadding: false}, 191 191 ]}> 192 - <Trans>What's up?</Trans> 192 + <Trans>What's poppin'?</Trans> 193 193 </Text> 194 194 <View style={[a.flex_row, a.gap_md]}> 195 195 {IS_NATIVE && (