Skip to content

Conversation

@jmgasper
Copy link
Contributor

@jmgasper jmgasper commented Jan 4, 2026

No description provided.

sso.email AS "SSO email"
FROM members.member m
JOIN identity."user" u
ON u.user_id = m."userId"::numeric(10, 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Casting m."userId" to numeric(10, 0) may lead to unexpected behavior if m."userId" contains non-numeric characters or exceeds the precision. Consider ensuring that m."userId" is always a valid numeric value or adjust the data type accordingly.

usl.sso_user_name,
usl.email
FROM identity.user_sso_login usl
WHERE usl.user_id = m."userId"::numeric(10, 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Similar to line 15, casting m."userId" to numeric(10, 0) in the WHERE clause may lead to unexpected behavior. Ensure that m."userId" is always a valid numeric value or adjust the data type accordingly.

usl.provider_id
LIMIT 1
) sso ON TRUE
WHERE m.email ILIKE '%@wipro.com'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
The WHERE clause filters by m.email ILIKE '%@wipro.com', which may lead to performance issues if the dataset is large and there is no index supporting this pattern match. Consider evaluating the need for an index or alternative filtering strategies.

description:
"Filter users created after this date (defaults to current date - 90 days)",
})
getTopgearHandles(@Query("startDate") startDate?: string) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The startDate parameter is expected to be a Date, but it is being passed as a string. Consider parsing it to a Date object before using it to ensure correct date handling.

}

async getTopgearHandles(opts: { startDate?: string }) {
const startDate = parseOptionalDate(opts.startDate) ?? subDays(new Date(), 90);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Consider validating the opts.startDate before parsing it with parseOptionalDate. If opts.startDate is not a valid date string, parseOptionalDate might return null, leading to unexpected behavior. Adding validation can prevent potential issues with invalid input.

@jmgasper jmgasper merged commit a3ddd2c into master Jan 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants