-
Notifications
You must be signed in to change notification settings - Fork 448
fix: rely-solely-on-hubspot-to-create-organisations #5739
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
fix: rely-solely-on-hubspot-to-create-organisations #5739
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Docker builds report
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5739 +/- ##
=======================================
Coverage 97.77% 97.77%
=======================================
Files 1255 1255
Lines 44357 44357
=======================================
Hits 43371 43371
Misses 986 986 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
api/tests/unit/integrations/lead_tracking/hubspot/test_unit_hubspot_lead_tracking.py
Outdated
Show resolved
Hide resolved
if not company: | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can a company not exist in Hubspot at this point? When it happens, what should we do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small indexation delay. Duplicated companies has been observed empirically and a case happened last week (I can share offline if you are interested).
With hubspot creating/associating under the hood the contact with the company. And this logic getting executed within 10 seconds => company not available from their API.
doc.
It may take a few moments for newly created or updated CRM objects to appear in search results.
So conclusion discussed with Uriel is to let it go, not have action on our side and rely only on hubspot engine. It's acceptable that our DB doesn't reflect 100% hubspot in similar cases
More details
Unique/clean data in hubspot > Our DB synchronization because before any update in hubspot (especially update_active_subscription
) we:
- Check
HubspotOrganisation
- If not synchronized
get_company_by_domain
and createHubspotOrganisation
for next time (and obviously in those later steps it should be available)
We don't make so much use of the hubspot_organisation_id
besides those operations.
Last thing, in this one, there is an additional 2 (or 3) minutes buffer before triggering this logic, that should mitigate the risks of not finding the record
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thank you for the explanation.
Couple things, if letting go is indeed the business decision here:
- Let's add a comment so this
return None
isn't prone to the reader's imagination. 😅 - Question: can letting go possibly lead to inconsistencies in the CRM layer?
…bspot_lead_tracking.py Co-authored-by: Evandro Myller <[email protected]>
Co-authored-by: Evandro Myller <[email protected]>
api/tests/unit/integrations/lead_tracking/hubspot/test_unit_hubspot_lead_tracking.py
Show resolved
Hide resolved
…t-hubspot-company-creation-in-association
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Hubspot does warn about XX seconds delay between a record is created and it's availability in their search API. It has created duplicates because on our side, we trigger
create_lead
that:Used to create the company in hubspot if not foundThis part is to be removed to trust hubspot associationAlso #5711 should reduce this case from happening by adding a delay before triggering
create_lead
This PR aims to remove the fallback of creating the organisation in hubspot if we couldn't find it by domain
How did you test this code?