diff --git a/backend/native/backend-ws/src/db/users.ts b/backend/native/backend-ws/src/db/users.ts index ca7386ef87..d21c92a5fe 100644 --- a/backend/native/backend-ws/src/db/users.ts +++ b/backend/native/backend-ws/src/db/users.ts @@ -11,6 +11,9 @@ const chain = Chain(AUTH_HASURA_URL, { export const getUsers = async ( userIds: string[] ): Promise<{ id: string; username: string }[]> => { + // hotfix: empty array returns all records + if (userIds.filter(Boolean).length === 0) return []; + const response = await chain("query")( { auth_users: [ diff --git a/backend/native/backpack-api/src/db/friendships.ts b/backend/native/backpack-api/src/db/friendships.ts index 4e9a47e52c..e91c9e54e5 100644 --- a/backend/native/backpack-api/src/db/friendships.ts +++ b/backend/native/backpack-api/src/db/friendships.ts @@ -456,6 +456,9 @@ export const getFriendshipStatus = async ( remoteRequested: boolean; }[] > => { + // hotfix: empty array returns all records + if (userIds.filter(Boolean).length === 0) return []; + const response = await chain("query")( { auth_friendships: [ diff --git a/backend/native/backpack-api/src/db/users.ts b/backend/native/backpack-api/src/db/users.ts index 90332f1dc0..5b85f3e37b 100644 --- a/backend/native/backpack-api/src/db/users.ts +++ b/backend/native/backpack-api/src/db/users.ts @@ -21,6 +21,9 @@ export const getUsersMetadata = async ( id: unknown; }[] > => { + // hotfix: empty array returns all records + if (userIds.filter(Boolean).length === 0) return []; + const response = await chain("query")( { auth_users: [ @@ -50,6 +53,9 @@ export const getUsers = async ( publicKeys: unknown[]; }[] > => { + // hotfix: empty array returns all records + if (userIds.filter(Boolean).length === 0) return []; + const response = await chain("query")( { auth_users: [