Sometimes the order "line item" sync request sent to hubspot will be processed before the "deal" sync request, causing an "INVALID LINE ITEM" error to be logged. The check_hubspot_api_errors task on our end sifts through that log every 10 minutes, and if it finds that error for a Line object that doesn't exist (based on integratorObjectId, itself based on order id), logs the error to sentry. If it does exist, it does another resync instead.
Actual Behavior
The above works for non-B2B orders, but B2B orders don't have Line objects and their integratorObjectId values are slightly different, not matching the expected pattern. Therefore the error is always logged to Sentry instead of waiting for a retry.
https://sentry.io/organizations/mit-office-of-digital-learning/issues/1078135432/?referrer=slack
Steps to Reproduce
Create some B2B orders. .
Expected Behavior
Sometimes the order "line item" sync request sent to hubspot will be processed before the "deal" sync request, causing an "INVALID LINE ITEM" error to be logged. The
check_hubspot_api_errors
task on our end sifts through that log every 10 minutes, and if it finds that error for aLine
object that doesn't exist (based onintegratorObjectId
, itself based on order id), logs the error to sentry. If it does exist, it does another resync instead.Actual Behavior
The above works for non-B2B orders, but B2B orders don't have
Line
objects and theirintegratorObjectId
values are slightly different, not matching the expected pattern. Therefore the error is always logged to Sentry instead of waiting for a retry.