server: catch unresolvable featured notes

Instead of throwing all featured notes away, just remove that specific one.

closes FoundKeyGang/FoundKey#407
This commit is contained in:
Johann150 2024-10-18 17:39:28 +02:00
parent 4aae4a5ffb
commit 6123df0ebd
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -464,7 +464,7 @@ async function updateFeatured(userId: User['id'], resolver: Resolver) {
const featuredNotes = await Promise.all(items const featuredNotes = await Promise.all(items
.filter(item => isPost(item)) .filter(item => isPost(item))
.slice(0, 5) .slice(0, 5)
.map(item => limit(() => resolveNote(item, resolver)))); .map(item => limit(() => resolveNote(item, resolver).catch(() => null))));
await db.transaction(async transactionalEntityManager => { await db.transaction(async transactionalEntityManager => {
await transactionalEntityManager.delete(UserNotePining, { userId: user.id }); await transactionalEntityManager.delete(UserNotePining, { userId: user.id });