fix(social): tighten comment on federated-stub filter

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 <homeUserId>@<domain>.
This commit is contained in:
Jannis Braun
2026-04-25 19:12:40 +02:00
parent b37d3bfa29
commit e99e0e7862
+4 -6
View File
@@ -689,12 +689,10 @@ export async function socialRoutes(app: FastifyInstance): Promise<void> {
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 <homeUserId>@<domain>).
// Exclude replicated federated stubs: their stored username is
// `<homeUserId>@<domain>`, 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),