Conversation
🦋 Changeset detectedLatest commit: 003b5d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe mobile app centralizes KYC status handling through ChangesKYC review and failure flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🟡 Moderate · up to Users whose identity verification is under review or has failed may be prompted to add funds instead of seeing the appropriate review or support flow. This can misdirect users during a blocking verification state and should be corrected before merge. Sequence Diagram(s)sequenceDiagram
participant User
participant AddFunds
participant useKYC
participant getKYCStatus
participant startKYC
participant GettingStarted
User->>AddFunds: Start bank transfer
AddFunds->>useKYC: Read KYC state
useKYC->>getKYCStatus: Fetch status
getKYCStatus-->>useKYC: Return status code
AddFunds->>startKYC: Begin verification when required
startKYC-->>AddFunds: Return complete or blocked
AddFunds->>GettingStarted: Redirect for review or blocked state
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bcac7d71b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/utils/persona.ts (1)
281-281: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winClassify the post-inquiry status before returning
complete.When the refetch returns
"processing"or"bad kyc", this returns"complete".src/components/add-funds/AddFunds.tsxroutes that non-approved complete result to home instead of getting started. Apply the same blocked classification used beforestartKYC()tokyc.Proposed fix
const kyc = await queryClient.fetchQuery<KYCStatus>({ queryKey: ["kyc", "status"], staleTime: 0 }); + const code = "code" in kyc ? kyc.code : undefined; + if (code !== "ok" && code !== "legacy kyc" && code !== "not started" && code !== "no kyc") { + return { status: "blocked", kyc }; + } return { status: "complete", kyc };
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Team
Run ID: 1ceb862d-9310-47bd-92fd-8108dfc227d4
📒 Files selected for processing (18)
.changeset/six-peas-beg.mdsrc/components/add-funds/AddFunds.tsxsrc/components/card/Card.tsxsrc/components/getting-started/GettingStarted.tsxsrc/components/getting-started/Step.tsxsrc/components/home/GettingStarted.tsxsrc/components/home/Home.tsxsrc/components/send-funds/SendFunds.tsxsrc/components/shared/FundingAlert.tsxsrc/components/shared/InfoAlert.tsxsrc/components/swaps/Swaps.tsxsrc/i18n/es-AR.jsonsrc/i18n/es.jsonsrc/i18n/pt.jsonsrc/utils/persona.tssrc/utils/server.tssrc/utils/useKYC.tssrc/utils/useOnboardingSteps.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1291 +/- ##
==========================================
- Coverage 73.37% 73.36% -0.01%
==========================================
Files 276 277 +1
Lines 13445 13469 +24
Branches 4704 4722 +18
==========================================
+ Hits 9865 9882 +17
- Misses 3241 3248 +7
Partials 339 339
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/utils/persona.ts (1)
274-281: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winClassify the post-inquiry KYC status before returning success. After
startKYC()resolves, the mutation fetches the status but always returnsstatus: "complete". When the API returnsprocessingorbad kyc,GettingStarted.tsxandSwaps.tsxroute the user home instead of to blocked onboarding. Returnblockedunless the fetched code isokorlegacy kyc.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Team
Run ID: 5be8df4f-194e-4a8b-9579-7da075bbcca4
📒 Files selected for processing (10)
.changeset/six-peas-beg.mdsrc/components/card/Card.tsxsrc/components/getting-started/GettingStarted.tsxsrc/components/home/GettingStarted.tsxsrc/components/swaps/Swaps.tsxsrc/i18n/es.jsonsrc/i18n/pt.jsonsrc/utils/server.tssrc/utils/useKYC.tssrc/utils/useOnboardingSteps.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Team
Run ID: 9b5fea01-0d4f-4d71-8997-1655394bc61e
📒 Files selected for processing (2)
src/components/getting-started/GettingStarted.tsxsrc/utils/useKYC.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
Summary by CodeRabbit