Conversation
Re-fetches Veriff decisions for every partner with a veriffSessionId and replays detectDuplicateIdentityFraud when risk labels are present, so partners flagged before #3765 also get partnerDuplicateAccount fraud events. Idempotent via hash-based dedup in createFraudEvents.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/scripts/migrations/backfill-veriff-duplicate-identity-fraud.ts`:
- Around line 74-94: The migration currently swallows per-partner errors and
exits 0; change main() to throw if the errored counter is >0 after processing so
failures surface (check the errored variable after batches and throw an Error
with context), and replace the bare main() call with main().catch(...) and
.finally(...) handlers that log the error, call process.exit(1) for failures,
and ensure Prisma disconnect is invoked (referencing main(), errored, and the
existing per-partner catch that logs partnerId/veriffSessionId).
- Around line 1-6: Move the side-effect import of dotenv-flow to run before any
modules that read env vars: place import "dotenv-flow/config" at the very top of
this file so it executes before importing detectDuplicateIdentityFraud,
fetchVeriffSessionDecision, VeriffRiskLabel/veriffRiskLabels, prisma and chunk;
this ensures module-initialization reads correct environment variables and
avoids uninitialized configuration during prisma and `@dub/utils` setup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e9d41f4e-251f-44da-a3f0-dc075d533858
📒 Files selected for processing (1)
apps/web/scripts/migrations/backfill-veriff-duplicate-identity-fraud.ts
Summary by CodeRabbit