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

Configure Feed

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

Handle getPosts/getStarterPacks errors in notification subject fetch

If a batch of URIs fails server-side validation when fetching
notification subjects, catch the error and return an empty result
instead of crashing the entire notification page. Notifications
still render without subject previews for the failed batch.

+6 -2
+6 -2
src/state/queries/notifications/util.ts
··· 231 231 const packUriChunks = chunk(Array.from(packUris), 25) 232 232 const postsChunks = await Promise.all( 233 233 postUriChunks.map(uris => 234 - agent.app.bsky.feed.getPosts({uris}).then(res => res.data.posts), 234 + agent.app.bsky.feed 235 + .getPosts({uris}) 236 + .then(res => res.data.posts) 237 + .catch(_e => [] as AppBskyFeedDefs.PostView[]), 235 238 ), 236 239 ) 237 240 const packsChunks = await Promise.all( 238 241 packUriChunks.map(uris => 239 242 agent.app.bsky.graph 240 243 .getStarterPacks({uris}) 241 - .then(res => res.data.starterPacks), 244 + .then(res => res.data.starterPacks) 245 + .catch(_e => [] as AppBskyGraphDefs.StarterPackViewBasic[]), 242 246 ), 243 247 ) 244 248 const postsMap = new Map<string, AppBskyFeedDefs.PostView>()