chore: sync main → dev (manual merge of #2049)#2062
Conversation
Fix migrated KYC withdrawal gate
…-05-18 # Conflicts: # src/components/Home/KycCompletedModal/index.tsx # src/hooks/useIdentityVerification.tsx
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR unifies KYC approval status checking across Manteca and Sumsub providers by introducing a shared ChangesUnified KYC approval status and provider handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
Code-analysis diffPainscore total: 5718.33 → 5719.77 (+1.44) 🆕 New findings (15)
✅ Resolved (14)
📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/components/Home/KycCompletedModal/index.tsx (1)
54-61: 💤 Low valueConsider removing merge-resolution comments before merging.
These inline comments document the conflict resolution process but add noise for future readers. The code itself is now self-explanatory with the unified
isKycStatusApprovedhelper.🧹 Suggested cleanup
user?.user.kycVerifications?.forEach((v) => { if ( - // dev: scoped to Manteca via `isMantecaSupportedCountryCode` helper. - // main: broadened to include SUMSUB-provider rows AND switched the - // status gate from `=== MantecaKycStatus.ACTIVE` to - // `isKycStatusApproved` (handles the post-migration cohort whose - // status enum is the unified Bridge/Manteca approved set, not the - // legacy Manteca-only ACTIVE). - // Merge: keep dev's helper for country-gate readability, take - // main's broader provider + status logic (the actual bugfix). (v.provider === 'MANTECA' || v.provider === 'SUMSUB') && isMantecaSupportedCountryCode(v.mantecaGeo) && isKycStatusApproved(v.status)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Home/KycCompletedModal/index.tsx` around lines 54 - 61, Remove the merge-resolution comment block that documents the conflict (the multiline comment containing dev/main/Merge notes) and leave the current implemented logic intact; specifically, keep the unified check that uses isMantecaSupportedCountryCode for the country gate and isKycStatusApproved for the status/provider logic, and delete the noisy merge commentary so the code reads cleanly around the Home/KycCompletedModal index where those helpers are used.src/hooks/useIdentityVerification.tsx (1)
7-11: 💤 Low valueConsider removing merge-resolution comments before merging.
These comments explain the conflict resolution process but aren't relevant for ongoing maintenance. They could be removed to keep the codebase clean.
🧹 Suggested cleanup
-// Auto-merger took main's broader body (`provider === 'MANTECA' || === 'SUMSUB'`, -// `isKycStatusApproved`) AND dev's helper call `isMantecaSupportedCountryCode`. -// That means `MantecaKycStatus` (was the strict status enum) and -// `MantecaSupportedExchanges` (was main's direct-map gate) are both unused -// post-merge — drop them. import { BRIDGE_ALPHA3_TO_ALPHA2, countryData } from '`@/components/AddMoney/consts`'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/hooks/useIdentityVerification.tsx` around lines 7 - 11, Remove the merge-resolution comment block left in useIdentityVerification.tsx that explains the conflict between main and dev (the note about `provider === 'MANTECA' || === 'SUMSUB'`, `isKycStatusApproved`, and the helper `isMantecaSupportedCountryCode`), and also delete the now-unused symbols left over from that merge (`MantecaKycStatus` and `MantecaSupportedExchanges`) so the file contains only the active logic (references to `isMantecaSupportedCountryCode`, provider checks, and `isKycStatusApproved`) without leftover commentary or dead declarations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/hooks/__tests__/kyc-withdrawal-gate.test.tsx`:
- Around line 5-10: The test currently mocks '`@/assets`' but
useIdentityVerification.tsx imports the globe constants from '`@/assets/icons`',
so the mock isn't applied; update the jest.mock target to '`@/assets/icons`' (or
add an additional jest.mock for '`@/assets/icons`') so the imported symbols like
EUROPE_GLOBE_ICON, LATAM_GLOBE_ICON, NORTH_AMERICA_GLOBE_ICON, and
REST_OF_WORLD_GLOBE_ICON are overridden with the mocked values used in the test.
---
Nitpick comments:
In `@src/components/Home/KycCompletedModal/index.tsx`:
- Around line 54-61: Remove the merge-resolution comment block that documents
the conflict (the multiline comment containing dev/main/Merge notes) and leave
the current implemented logic intact; specifically, keep the unified check that
uses isMantecaSupportedCountryCode for the country gate and isKycStatusApproved
for the status/provider logic, and delete the noisy merge commentary so the code
reads cleanly around the Home/KycCompletedModal index where those helpers are
used.
In `@src/hooks/useIdentityVerification.tsx`:
- Around line 7-11: Remove the merge-resolution comment block left in
useIdentityVerification.tsx that explains the conflict between main and dev (the
note about `provider === 'MANTECA' || === 'SUMSUB'`, `isKycStatusApproved`, and
the helper `isMantecaSupportedCountryCode`), and also delete the now-unused
symbols left over from that merge (`MantecaKycStatus` and
`MantecaSupportedExchanges`) so the file contains only the active logic
(references to `isMantecaSupportedCountryCode`, provider checks, and
`isKycStatusApproved`) without leftover commentary or dead declarations.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 140ece0e-d83e-4f73-884f-4902ce8cc91d
📒 Files selected for processing (4)
src/components/Home/KycCompletedModal/index.tsxsrc/hooks/__tests__/kyc-withdrawal-gate.test.tsxsrc/hooks/useIdentityVerification.tsxsrc/hooks/useUnifiedKycStatus.ts
Manual-merge replacement for #2049 (which has unresolved conflicts).
Conflicts
Two files, both touched by:
`src/components/Home/KycCompletedModal/index.tsx`
Both sides rewrote the verification-matching block in the `isMantecaApproved` useEffect.
Net: kept dev's country helper, took main's broader provider + status logic. Dropped unused `MantecaKycStatus` and `MantecaSupportedExchanges` imports.
`src/hooks/useIdentityVerification.tsx`
Same pattern — single-block import conflict; the body was auto-merged with dev's helper (`isMantecaSupportedCountryCode`) + main's broader logic (`provider === MANTECA || SUMSUB`, `isKycStatusApproved`). Cleaned up unused imports that the auto-merge left dangling.
Verification
Closes #2049.