From 029175543420848f9db0a4274cceca6f59af3e85 Mon Sep 17 00:00:00 2001 From: Florian <45694132+flo-bit@users.noreply.github.com> Date: Wed, 28 Jan 2026 12:44:08 +0100 Subject: [PATCH] fix invalid handle --- src/lib/atproto/methods.ts | 6 +++++- src/lib/cards/SpecialCards/UpdatedBlentos/index.ts | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/atproto/methods.ts b/src/lib/atproto/methods.ts index 2b92187..abbbc05 100644 --- a/src/lib/atproto/methods.ts +++ b/src/lib/atproto/methods.ts @@ -93,7 +93,11 @@ export async function getDetailedProfile(data?: { did?: Did; client?: Client }) params: { actor: data.did } }); - if (!response.ok) return; + if (!response.ok || response.data.handle === 'handle.invalid') { + // fall back to describe repo + const repo = await describeRepo({ did: data.did, client: data.client }); + return { handle: repo?.handle ?? 'handle.invalid', did: data.did }; + } return response.data; } diff --git a/src/lib/cards/SpecialCards/UpdatedBlentos/index.ts b/src/lib/cards/SpecialCards/UpdatedBlentos/index.ts index a935ce3..6615ecc 100644 --- a/src/lib/cards/SpecialCards/UpdatedBlentos/index.ts +++ b/src/lib/cards/SpecialCards/UpdatedBlentos/index.ts @@ -30,7 +30,15 @@ export const UpdatedBlentosCardDefitition = { for (const did of Array.from(uniqueDids)) { const profile = getDetailedProfile({ did }); profiles.push(profile); - if (profiles.length > 20) break; + if (profiles.length > 30) break; + } + + for (let i = existingUsersArray.length - 1; i >= 0; i--) { + // if handle is handle.invalid, remove from existing users and add to profiles to refresh + if (existingUsersArray[i].handle === 'handle.invalid') { + const removed = existingUsersArray.splice(i, 1)[0]; + profiles.push(getDetailedProfile({ did: removed.did })); + } } const result = [...(await Promise.all(profiles)), ...existingUsersArray]; -- 2.51.2