From 44da33e46d65a5604a97cb35fc95c436fbd18cf4 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Wed, 11 Feb 2026 14:13:31 +0400 Subject: [PATCH] explicitly set if documents are indexed after checking pds host --- .../functions/sync_document_metadata.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/api/inngest/functions/sync_document_metadata.ts b/app/api/inngest/functions/sync_document_metadata.ts index d2836a2a..35acb38d 100644 --- a/app/api/inngest/functions/sync_document_metadata.ts +++ b/app/api/inngest/functions/sync_document_metadata.ts @@ -21,17 +21,18 @@ export const sync_document_metadata = inngest.createFunction( const handle = doc?.alsoKnownAs ?.find((a) => a.startsWith("at://")) ?.replace("at://", ""); - return { handle: handle ?? null, isBridgy: handle?.includes("brid.gy") ?? false }; + const isBridgy = !!doc?.service?.find( + (s) => s.serviceEndpoint === "https://atproto.brid.gy", + ); + return { handle: handle ?? null, isBridgy }; }); - if (handleResult.isBridgy) { - await step.run("set-unindexed", async () => { - await supabaseServerClient - .from("documents") - .update({ indexed: false }) - .eq("uri", document_uri); - }); - } + await step.run("set-indexed", async () => { + await supabaseServerClient + .from("documents") + .update({ indexed: !handleResult.isBridgy }) + .eq("uri", document_uri); + }); if (!bsky_post_uri || handleResult.isBridgy) { return { handle: handleResult.handle }; -- 2.51.2