Skip to content

Commit e7c153c

Browse files
committed
fix: test not joining for member count
Signed-off-by: Umberto Sgueglia <[email protected]>
1 parent 602b221 commit e7c153c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • services/libs/data-access-layer/src/affiliations

services/libs/data-access-layer/src/affiliations/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export async function findWorkExperiencesBulk(
3333
): Promise<IWorkRow[]> {
3434
const rows: IWorkRow[] = await qx.select(
3535
`
36+
/* TODO: re-enable memberCount tiebreaker once performance is acceptable
3637
WITH relevant_orgs AS (
3738
SELECT DISTINCT "organizationId"
3839
FROM "memberOrganizations"
@@ -52,6 +53,7 @@ export async function findWorkExperiencesBulk(
5253
)
5354
GROUP BY osa."organizationId"
5455
)
56+
*/
5557
SELECT
5658
mo.id,
5759
mo."memberId",
@@ -62,12 +64,12 @@ export async function findWorkExperiencesBulk(
6264
mo."dateEnd",
6365
mo."createdAt",
6466
COALESCE(ovr."isPrimaryWorkExperience", false) AS "isPrimaryWorkExperience",
65-
COALESCE(a.total_count, 0) AS "memberCount",
67+
0 AS "memberCount", -- TODO: restore COALESCE(a.total_count, 0) when re-enabling aggs
6668
NULL::text AS "segmentId"
6769
FROM "memberOrganizations" mo
6870
JOIN organizations o ON mo."organizationId" = o.id
6971
LEFT JOIN "memberOrganizationAffiliationOverrides" ovr ON ovr."memberOrganizationId" = mo.id
70-
LEFT JOIN aggs a ON a."organizationId" = mo."organizationId"
72+
-- LEFT JOIN aggs a ON a."organizationId" = mo."organizationId" -- TODO: restore when re-enabling aggs
7173
WHERE mo."memberId" IN ($(memberIds:csv))
7274
AND mo."deletedAt" IS NULL
7375
AND COALESCE(ovr."allowAffiliation", true) = true

0 commit comments

Comments
 (0)