Skip to content

fix: update stripe email when changing email in account settings#5992

Open
0xi4o wants to merge 3 commits intomainfrom
fix/stripe-email
Open

fix: update stripe email when changing email in account settings#5992
0xi4o wants to merge 3 commits intomainfrom
fix/stripe-email

Conversation

@0xi4o
Copy link
Contributor

@0xi4o 0xi4o commented Mar 17, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 addresses a critical synchronization issue by ensuring that when a user updates their email address in the application's account settings, their corresponding customer email in Stripe is also automatically updated. This prevents discrepancies between the application's user data and Stripe's billing information, improving data consistency and user experience for cloud deployments.

Highlights

  • Stripe Email Synchronization: Implemented functionality to automatically update a user's email in Stripe when they change their email within the application's account settings.
  • Stripe Integration Enhancements: Introduced new methods in IdentityManager and StripeManager to facilitate updating customer emails via the Stripe API.
  • Cloud-Specific Logic: The Stripe email update logic is specifically applied to CLOUD platform deployments and handles cases where a user is associated with a single organization they created.
Changelog
  • packages/server/src/IdentityManager.ts
    • Added updateStripeCustomerEmail method to delegate Stripe customer email updates.
  • packages/server/src/StripeManager.ts
    • Added updateCustomerEmail method to directly interact with the Stripe API for updating customer emails.
  • packages/server/src/enterprise/services/user.service.ts
    • Imported logger, Platform, OrganizationService, and OrganizationUserService.
    • Introduced logic within the user update process to detect email changes.
    • Implemented conditional logic to update Stripe customer email for CLOUD platform users who are the sole creators of an organization with a Stripe customer ID.
    • Added error handling and logging for Stripe update operations.
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.

@0xi4o 0xi4o requested review from HenryHengZJ and yau-wd March 17, 2026 09:32
Copy link
Contributor

@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 adds functionality to update a user's email in Stripe when it's changed in the account settings. The implementation introduces new methods in IdentityManager and StripeManager and adds logic to user.service.ts to trigger the update. My review focuses on improving consistency, error handling, and the clarity of the new logic.

// Update Stripe customer email when user changes email (CLOUD only; expect exactly one org)
const appServer = getRunningExpressApp()
if (appServer.identityManager.getPlatformType() === Platform.CLOUD && updatedUser.email && updatedUser.email !== currentEmail) {
const organizationUserService = new OrganizationUserService()
Copy link
Contributor

Choose a reason for hiding this comment

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

make sure there is no circular dependency, as in OrganizationUserService does not import back UserService, same as OrganizationService

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