a tool for shared writing and social publishing

explicitly set if documents are indexed after checking pds host

+10 -9
+10 -9
app/api/inngest/functions/sync_document_metadata.ts
··· 21 21 const handle = doc?.alsoKnownAs 22 22 ?.find((a) => a.startsWith("at://")) 23 23 ?.replace("at://", ""); 24 - return { handle: handle ?? null, isBridgy: handle?.includes("brid.gy") ?? false }; 24 + const isBridgy = !!doc?.service?.find( 25 + (s) => s.serviceEndpoint === "https://atproto.brid.gy", 26 + ); 27 + return { handle: handle ?? null, isBridgy }; 25 28 }); 26 29 27 - if (handleResult.isBridgy) { 28 - await step.run("set-unindexed", async () => { 29 - await supabaseServerClient 30 - .from("documents") 31 - .update({ indexed: false }) 32 - .eq("uri", document_uri); 33 - }); 34 - } 30 + await step.run("set-indexed", async () => { 31 + await supabaseServerClient 32 + .from("documents") 33 + .update({ indexed: !handleResult.isBridgy }) 34 + .eq("uri", document_uri); 35 + }); 35 36 36 37 if (!bsky_post_uri || handleResult.isBridgy) { 37 38 return { handle: handleResult.handle };