Skip to content

✨ server: handle incomplete bridge endorsements#1125

Merged
cruzdanilo merged 1 commit into
mainfrom
incomplete
Jul 3, 2026
Merged

✨ server: handle incomplete bridge endorsements#1125
cruzdanilo merged 1 commit into
mainfrom
incomplete

Conversation

@mainqueg

@mainqueg mainqueg commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Fixed bridge user routing when endorsements exist but are all incomplete, correctly sending affected customers to onboarding with the right KYC link.
    • Improved KYC-link eligibility checks to detect missing requirements within more complex, nested “issues” structures.
  • Tests
    • Expanded onboarding provider selection coverage, including verification of redirect URL propagation and ensuring exceptions aren’t captured for the missing-requirements scenario.
  • Chores
    • Added a patch release note: “handle incomplete bridge endorsements”.

@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3802a96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/server Patch

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

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cruzdanilo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e0138d38-47aa-4eb4-b1e5-bc2e6b460c24

📥 Commits

Reviewing files that changed from the base of the PR and between a03e267 and 3802a96.

📒 Files selected for processing (3)
  • .changeset/quiet-otters-onboard.md
  • server/test/utils/bridge.test.ts
  • server/utils/ramps/bridge.ts

Walkthrough

This PR updates bridge provider onboarding so active customers with only incomplete endorsements return ONBOARDING with a kycLink, expands KYC issue matching to handle nested object shapes, and adds tests plus a patch changeset entry.

Changes

Bridge onboarding gating

Layer / File(s) Summary
ONBOARDING short-circuit and KYC link gating logic
server/utils/ramps/bridge.ts
Imports record from valibot; getProvider now returns ONBOARDING with kycLink when an active customer's endorsements are all incomplete; expands missing/issues sets; replaces string-set membership checking with a recursive helper that handles strings, arrays, and record objects.
ONBOARDING and kycLink coverage
server/test/utils/bridge.test.ts, .changeset/quiet-otters-onboard.md
Adds tests for object-shaped issue nodes, nested missing requirements with redirectURL/query-param propagation, and database check issue scenarios; adds a patch changeset note for handling incomplete bridge endorsements.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant getProvider
  participant maybeKYCLink
  participant hasIssue

  Client->>getProvider: request provider status
  getProvider->>getProvider: detect active status with incomplete endorsements
  getProvider->>maybeKYCLink: compute kycLink
  maybeKYCLink->>hasIssue: evaluate requirements.issues
  hasIssue-->>maybeKYCLink: match result
  maybeKYCLink-->>getProvider: kycLink
  getProvider-->>Client: ONBOARDING response
Loading

Possibly related PRs

  • exactly/exa#950: Both PRs modify bridge onboarding KYC-link gating logic, including recursive matching and redirect propagation.
  • exactly/exa#1079: Both PRs change getProvider onboarding eligibility behavior in server/utils/ramps/bridge.ts.
  • exactly/exa#814: This PR stays in the same bridge onramp provider flow and endorsement handling area.

Suggested reviewers: nfmelendez, cruzdanilo

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely matches the main change: handling incomplete bridge endorsements in the server.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch incomplete
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch incomplete

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for handling incomplete bridge endorsements when a user's status is active, expanding the sets of missing requirements and issues, and introducing a recursive containsIssue function to parse nested issues. Feedback suggests optimizing the containsIssue function by replacing Valibot's safeParse with standard JavaScript checks (Array.isArray and typeof node === "object") to reduce overhead, and subsequently removing the unused record import.

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.

Comment thread server/utils/ramps/bridge.ts Outdated
Comment thread server/utils/ramps/bridge.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2d284ed3-af9e-4a50-9c00-73b61089e91f

📥 Commits

Reviewing files that changed from the base of the PR and between 5dda070 and 27d86fb.

📒 Files selected for processing (3)
  • .changeset/quiet-otters-onboard.md
  • server/test/utils/bridge.test.ts
  • server/utils/ramps/bridge.ts

Comment thread server/utils/ramps/bridge.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27d86fb043

ℹ️ 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".

Comment thread server/utils/ramps/bridge.ts Outdated
Comment thread server/utils/ramps/bridge.ts
Comment thread server/utils/ramps/bridge.ts
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.21%. Comparing base (ed5f97f) to head (a03e267).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1125      +/-   ##
==========================================
+ Coverage   72.46%   73.21%   +0.75%     
==========================================
  Files         249      249              
  Lines       10091    10395     +304     
  Branches     3274     3405     +131     
==========================================
+ Hits         7312     7611     +299     
- Misses       2500     2503       +3     
- Partials      279      281       +2     
Flag Coverage Δ
e2e 73.21% <100.00%> (+0.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mainqueg
mainqueg force-pushed the incomplete branch 2 times, most recently from 4329f86 to a03e267 Compare July 1, 2026 18:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a03e267be1

ℹ️ 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".

Comment thread server/utils/ramps/bridge.ts
@cruzdanilo
cruzdanilo merged commit 3802a96 into main Jul 3, 2026
2 of 4 checks passed
@cruzdanilo
cruzdanilo deleted the incomplete branch July 3, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants