Conversation
🦋 Changeset detectedLatest commit: bd9903b 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1071 +/- ##
==========================================
+ Coverage 74.95% 75.18% +0.23%
==========================================
Files 245 245
Lines 11658 11767 +109
Branches 4050 4101 +51
==========================================
+ Hits 8738 8847 +109
- Misses 2598 2599 +1
+ Partials 322 321 -1
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.
Code Review
This pull request adds support for a future KYC link in the Bridge provider. It updates the ProviderInfo and CustomerResponse schemas, implements a helper function futureKYCLink to filter and retrieve the earliest future requirement within a 30-day window, and adds comprehensive test coverage. Feedback suggests refactoring the futureKYCLink function to return a consistent Promise by declaring it async, replacing toSorted with sort for better compatibility, and using async/await with try/catch for improved readability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Warning Review limit reached
More reviews will be available in 22 minutes and 59 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughAdds an optional ChangesBridge Future KYC Link
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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: 7ef72285cd
ℹ️ 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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c3e6cdfd-6eac-4198-88d8-b9cb4d4a7451
📒 Files selected for processing (4)
.changeset/swift-otters-prepare.mdserver/api/ramp.tsserver/test/utils/bridge.test.tsserver/utils/ramps/bridge.ts
406ecf2 to
74e0362
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
server/utils/ramps/bridge.ts (1)
1063-1068:⚠️ Potential issue | 🟠 Major | ⚡ Quick winExclude past-due requirements from the future window filter.
Line 1066 only enforces the upper bound, so already-expired
effective_datevalues (negative delta) are still eligible and can producefutureKYCLinkincorrectly.proposed fix
function futureKYCLink(bridgeUser: InferOutput<typeof CustomerResponse>, redirectUri?: string) { + const now = Date.now(); const next = bridgeUser.endorsements .flatMap((endorsement) => endorsement.future_requirements ?? []) .filter( - (requirement) => - requirement.pending.length === 0 && - new Date(requirement.effective_date).getTime() - Date.now() <= FutureKYCWindowMs, + (requirement) => { + const delta = new Date(requirement.effective_date).getTime() - now; + return requirement.pending.length === 0 && delta >= 0 && delta <= FutureKYCWindowMs; + }, ) .toSorted((a, b) => new Date(a.effective_date).getTime() - new Date(b.effective_date).getTime())[0];
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4bc3a048-7ed4-4302-850b-99d02d6f0fa9
📒 Files selected for processing (4)
.changeset/swift-otters-prepare.mdserver/api/ramp.tsserver/test/utils/bridge.test.tsserver/utils/ramps/bridge.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74e036270c
ℹ️ 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b75da58303
ℹ️ 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".
| (requirement) => | ||
| requirement.pending.length === 0 && | ||
| new Date(requirement.effective_date).getTime() - Date.now() <= FutureKYCWindowMs, |
There was a problem hiding this comment.
Check future missing requirements instead of pending
When Bridge returns future requirements that include user-actionable missing items plus pending internal-review items, this filter drops the requirement because pending.length !== 0, so the API never returns a futureKYCLink before the effective date. Bridge models future_requirements like requirements, where missing is what the customer can resolve; the docs' example has pending manual-review entries alongside a missing post_processing item, which this logic would skip.
Useful? React with 👍 / 👎.
| ) | ||
| .toSorted((a, b) => new Date(a.effective_date).getTime() - new Date(b.effective_date).getTime())[0]; | ||
| if (!next) return; | ||
| return getKYCLink(bridgeUser.id, redirectUri) |
There was a problem hiding this comment.
Request the KYC link for the affected endorsement
When the earliest future requirement belongs to an endorsement-specific rail such as sepa, this calls getKYCLink without the endorsement, even though the helper supports an endorsement query parameter and Bridge requires endorsement=sepa/spei to enable those specific hosted steps. In that scenario the API can return a futureKYCLink that opens the default KYC flow rather than the flow needed to satisfy the future requirement, leaving the user unable to resolve it.
Useful? React with 👍 / 👎.
Summary by CodeRabbit