Skip to content

Re-enable handling of duplicate hermes ids #282

@PrenSJ2

Description

@PrenSJ2

Problem

When there are two of anything (Org, Person, Deal ...) in Pipedrive, and the sales team want to merge these two items (whether it be hermes fault or a company singing up twice etc)

  • Pipedrive will combine the hermes_id PD data fields together, resulting in the value = 1234, 2344.
  • Then a webhook of the change is sent to hermes.
  • ValidationError

each webhook object from pd contains a CURRENT and PREVIOUS objs, hermes uses to check if anything has changed in the webhook before we apply the changes to the Hermes data.

this causes additional errors as we validate the pervious object in order to do the later comparison.

which in turn causes the validationError to happen again, this time on only the PREVIOUS object.

Proposed Solution

  1. call handle_duplicate_hermes_ids only if the hermes_id is a string but only on the CURRENT
  2. only update the objects if there has been a change

Additional thoughts

  • we might have to ignore PREVIOUS custom fields if they cause an error, otherwise even after we fix (put to PD) then receive webhook the error will still occur. causing an infinite loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions