fix: correctly handle issues relation array in linkPrToClaim (#123)#228
fix: correctly handle issues relation array in linkPrToClaim (#123)#228Sujini-kudupudi wants to merge 4 commits into
Conversation
|
@Sujini-kudupudi is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
hey @Sujini-kudupudi, fix looks correct for
.select('user_id, issues!inner(repo_full_name, repo_language)')
...
const issue = row.issues as unknown as { repo_full_name: string; repo_language: string | null };no array handling, no defensive guard. when supabase returns the joined two things to add:
related: it's worth tagging issue #123 in the PR body so reviewers know what user-visible bug this fixes. closes the loop. once site 3 is patched and there's a test, this is mergeable. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
CI checks fails, please fix it |
Summary
This PR fixes a bug where
skip-historycounting was silently broken in production due to an improperly typed cast of theissuesrelation. Theissuesrelation returned from Supabase was being incorrectly accessed as a single object instead of an array, which caused failures when populatingskipHistoryMapand linking opened PRs to claims.Type of Change
Related Issue
Closes #123
What was changed?
unwrapJoinhelper insrc/lib/supabase/inner-join.tsto seamlessly handle Supabase!innerjoin relation arrays.linkPrToClaimandtryLinkByIssueRefinsrc/inngest/functions/process-pr-event.tsto use the new helper.src/inngest/functions/recommendations-build.tsto fix theskipHistoryMappopulation bug.if (!issue?.repo_full_name) continue;to ensure safe property access.process-pr-event.test.tsagainstlinkPrToClaimto prove the fix against both single object and array responses.Screenshots
N/A - Backend webhook and cron job fix only.
Checklist
npm run devandnpm test)