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:
@@ -689,12 +689,10 @@ export async function socialRoutes(app: FastifyInstance): Promise<void> {
|
|||||||
eq(schema.users.isDeleted, 0),
|
eq(schema.users.isDeleted, 0),
|
||||||
eq(schema.users.discoverable, 1),
|
eq(schema.users.discoverable, 1),
|
||||||
ne(schema.users.id, request.userId),
|
ne(schema.users.id, request.userId),
|
||||||
// Exclude replicated federated stubs — federated users are surfaced
|
// Exclude replicated federated stubs: their stored username is
|
||||||
// via the client-side cross-instance fan-out in
|
// `<homeUserId>@<domain>`, so a substring of the domain would match
|
||||||
// packages/web/src/stores/socialStore.ts (searchUsers), which dedupes
|
// every stub from that instance. Federated users are surfaced via
|
||||||
// by canonical identity. Returning stubs here would be a noisy
|
// the client-side cross-instance fan-out instead.
|
||||||
// duplicate source AND would leak domain-suffix substring matches
|
|
||||||
// (stubs are stored as <homeUserId>@<domain>).
|
|
||||||
sql`(${schema.users.homeInstance} IS NULL OR ${schema.users.homeInstance} = '')`,
|
sql`(${schema.users.homeInstance} IS NULL OR ${schema.users.homeInstance} = '')`,
|
||||||
or(
|
or(
|
||||||
like(schema.users.username, pattern),
|
like(schema.users.username, pattern),
|
||||||
|
|||||||
Reference in New Issue
Block a user