Skip to content

🐛 server: handle failed onboarding tasks in manteca#831

Draft
mainqueg wants to merge 1 commit intomainfrom
status
Draft

🐛 server: handle failed onboarding tasks in manteca#831
mainqueg wants to merge 1 commit intomainfrom
status

Conversation

@mainqueg
Copy link
Contributor

@mainqueg mainqueg commented Feb 23, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Treat failed onboarding tasks as requiring onboarding so users are correctly directed to complete verification; ensures proper provider status and logging of the condition.
  • Tests
    • Added a test covering the failed-onboarding-task scenario.
  • Chores
    • Added a changelog/changeset entry for a patch release.

@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

🦋 Changeset detected

Latest commit: 89fe898

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

@gemini-code-assist
Copy link

Summary of Changes

Hello @mainqueg, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the server's manteca utility by introducing robust handling for users who have failed required onboarding tasks. The primary goal is to ensure that such users are correctly identified and their status reflects the need to complete their onboarding, improving the user experience and system accuracy. The changes include new logic, updated type definitions, and corresponding test coverage.

Highlights

  • Failed Onboarding Task Handling: Implemented logic within the manteca utility to correctly identify and handle users who have failed required onboarding tasks. Previously, these users might not have been categorized appropriately.
  • Status Update: Users with one or more failed required onboarding tasks will now be assigned an ONBOARDING status, ensuring they are directed back to complete their onboarding process.
  • Error Reporting: Integrated Sentry exception capturing for instances where a user is found to have failed required onboarding tasks, providing visibility into these occurrences.
  • Test Coverage: Added a new test case to manteca.test.ts to verify that the getProvider function returns the ONBOARDING status when a user has failed required tasks.
  • Type Definition Update: Updated the onboardingTaskStatus type definition to include 'FAILED' as a possible status, aligning with the new handling logic.
Changelog
  • .changeset/fancy-ends-dance.md
    • Added a new changeset file for the patch.
  • server/test/utils/manteca.test.ts
    • Added a test case to verify that getProvider returns ONBOARDING status for users with failed required tasks.
  • server/utils/ramps/manteca.ts
    • Implemented logic to detect and handle users with failed required onboarding tasks, returning an ONBOARDING status.
    • Added Sentry exception capturing for failed onboarding task scenarios.
    • Updated the onboardingTaskStatus array to include 'FAILED' as a valid status.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8478f3a and 63c2115.

📒 Files selected for processing (3)
  • .changeset/fancy-ends-dance.md
  • server/test/utils/manteca.test.ts
  • server/utils/ramps/manteca.ts

Walkthrough

Adds handling for FAILED required onboarding tasks in manteca: getProvider now detects FAILED tasks, logs a Sentry warning, and returns ONBOARDING; updates onboardingTaskStatus enum, adds a test for the FAILED case, and includes a changeset entry.

Changes

Cohort / File(s) Summary
Changeset entry
.changeset/fancy-ends-dance.md
Adds a new changeset declaring a patch for @exactly/server with a note about handling failed onboarding tasks in manteca.
Manteca logic
server/utils/ramps/manteca.ts
Adds a pre-PENDING check for required onboarding tasks with status FAILED; logs a Sentry warning and returns ONBOARDING with full currency list and empty cryptoCurrencies. Adds FAILED to onboardingTaskStatus and adjusts related types/order.
Tests
server/test/utils/manteca.test.ts
Adds a test asserting getProvider returns ONBOARDING when a required onboarding task has FAILED status.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant getProvider as "getProvider\n(server/utils/ramps/manteca.ts)"
  participant Sentry as "Sentry"
  Caller->>getProvider: request provider info
  getProvider->>getProvider: fetch onboarding tasks
  alt any required task == FAILED
    getProvider->>Sentry: captureWarning("has failed tasks", context={...})
    getProvider-->>Caller: return ONBOARDING (full currencies, cryptoCurrencies: [])
  else no FAILED (pending or none)
    getProvider-->>Caller: continue existing flow (NOT_STARTED / ONBOARDING)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • nfmelendez
  • cruzdanilo
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: handling failed onboarding tasks in manteca, which aligns with the core modifications across the changeset files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch status

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 and usage tips.

Copy link

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

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 aims to explicitly handle user onboarding tasks with a 'FAILED' status by introducing a check in the getProvider function in manteca.ts, ensuring these cases are logged to Sentry and the user's status is correctly set to 'ONBOARDING'. A medium-severity security vulnerability has been identified: the error handling now logs a complete user object containing Personally Identifiable Information (PII) to an external service, which requires remediation to protect user data. Additionally, a suggestion has been made regarding a TODO comment for improved long-term maintainability by tracking it in a project management tool.

(task) => task.required && task.status === "FAILED",
);
if (hasFailedTasks) {
// TODO handle failed required tasks

Choose a reason for hiding this comment

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

medium

While adding a TODO is a good way to flag areas for future improvement, it's generally better practice to track this kind of work in a project management tool (like Jira or GitHub Issues). This helps ensure that the task doesn't get lost and can be properly prioritized. Could you create a ticket for this and reference it here instead of leaving a TODO comment in the code?

Copy link

@coderabbitai coderabbitai bot left a comment

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

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b2b810 and 8478f3a.

📒 Files selected for processing (3)
  • .changeset/fancy-ends-dance.md
  • server/test/utils/manteca.test.ts
  • server/utils/ramps/manteca.ts

@sentry
Copy link

sentry bot commented Feb 24, 2026

✅ All tests passed.

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.

1 participant