From e99e0e7862c30cf198763b6ab96dc33ba8a277b6 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Sat, 25 Apr 2026 19:12:40 +0200 Subject: [PATCH] fix(social): tighten comment on federated-stub filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the file-path reference per code-review suggestion (paths in comments rot); keep the load-bearing why — substring of the domain matches every stub because stubs are stored as @. --- packages/server/src/routes/social.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/server/src/routes/social.ts b/packages/server/src/routes/social.ts index 4cf3e6d1..faa18956 100644 --- a/packages/server/src/routes/social.ts +++ b/packages/server/src/routes/social.ts @@ -689,12 +689,10 @@ export async function socialRoutes(app: FastifyInstance): Promise { eq(schema.users.isDeleted, 0), eq(schema.users.discoverable, 1), ne(schema.users.id, request.userId), - // Exclude replicated federated stubs — federated users are surfaced - // via the client-side cross-instance fan-out in - // packages/web/src/stores/socialStore.ts (searchUsers), which dedupes - // by canonical identity. Returning stubs here would be a noisy - // duplicate source AND would leak domain-suffix substring matches - // (stubs are stored as @). + // Exclude replicated federated stubs: their stored username is + // `@`, so a substring of the domain would match + // every stub from that instance. Federated users are surfaced via + // the client-side cross-instance fan-out instead. sql`(${schema.users.homeInstance} IS NULL OR ${schema.users.homeInstance} = '')`, or( like(schema.users.username, pattern),