Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new hubspot_api version and try to sync contacts individually if a batched sync chunk fails #2653

Merged
merged 1 commit into from
May 30, 2023

Conversation

mbertrand
Copy link
Member

Pre-Flight checklist

  • Testing
    • Code is tested
    • Changes have been manually tested

What's this PR do?

  • Uses the new version of mitol.hubspot_api which can handle conflicts caused by a Hubspot contact having 2 emails associated with different bootcamps users
  • Modifies the batch create/update tasks to try syncing contacts individually (to hit code above) if any API exceptions occur when running batch sync operations.

How should this be manually tested?

  • Ask for access to the xprodev sandbox account for hubspot if you don't already have it.
  • Copy the HUBSPOT_* settings values from RC to your .env file

Part 1:

  • Create a new user in xpro, something like fake_user+1@gmail.com
  • Find the contact in hubspot (may take a minute or so to show up) and add a secondary email to that contact: fake_user+2@gmail.com
Screenshot 2023-05-11 at 10 30 32 AM
  • Register another new user with that same email - fake_user+2@gmail.com
  • Check back on hubspot, that secondary email should be gone from the contact, and there should be a new contact with email fake_user+2@gmail.com

Part 2:

  • Comment out your hubspot .env settings and restart your containers
  • Create another new user, fake_user+3@gmail.com
  • In hubspot, add that email to one of the existing contacts as a secondary email
  • Uncomment your hubspot .env settings and restart your containers
  • Run manage.py sync_db_to_hubspot --users create. It should complete successfully
  • Check hubspot again, the secondary email from the contact should be gone and assigned to a new contact.

@odlbot odlbot temporarily deployed to xpro-ci-pr-2653 May 23, 2023 18:01 Inactive
@arslanashraf7 arslanashraf7 self-assigned this May 25, 2023
Copy link
Contributor

@arslanashraf7 arslanashraf7 left a comment

Choose a reason for hiding this comment

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

👍 Looks good, Also tested the PR and it works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants