From 64c07c71116617081ed23fcfaad81b4acd474517 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Mon, 9 Feb 2026 15:35:45 +0400 Subject: [PATCH] don't sync bsky likes of brid.gy posts --- app/api/inngest/functions/sync_bsky_likes.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/api/inngest/functions/sync_bsky_likes.ts b/app/api/inngest/functions/sync_bsky_likes.ts index 9b67aab8..69dfe3c6 100644 --- a/app/api/inngest/functions/sync_bsky_likes.ts +++ b/app/api/inngest/functions/sync_bsky_likes.ts @@ -1,6 +1,7 @@ import { inngest } from "../client"; import { supabaseServerClient } from "supabase/serverClient"; -import { AtpAgent } from "@atproto/api"; +import { AtpAgent, AtUri } from "@atproto/api"; +import { idResolver } from "app/(home-pages)/reader/idResolver"; const TOTAL_ITERATIONS = 144; // 36 hours at 15-minute intervals @@ -13,6 +14,19 @@ export const sync_bsky_likes = inngest.createFunction( async ({ event, step }) => { const { document_uri, bsky_post_uri } = event.data; + const isBridgy = await step.run("check-bridgy", async () => { + const did = new AtUri(bsky_post_uri).host; + const doc = await idResolver.did.resolve(did); + const handle = doc?.alsoKnownAs + ?.find((a) => a.startsWith("at://")) + ?.replace("at://", ""); + return handle?.includes("brid.gy") ?? false; + }); + + if (isBridgy) { + return { skipped: true, reason: "brid.gy post" }; + } + const agent = new AtpAgent({ service: "https://public.api.bsky.app" }); const fetchAndUpdate = async () => { -- 2.51.2