Skip to content

[BUG] Breaking change on Hubspot common -> New contact property change #18339

@choeqq

Description

@choeqq

Describe the bug
The hubspot-new-contact-property-change trigger fails when deployed via Pipedream SDK/API with error operator GTE requires a value. The trigger makes malformed HubSpot API requests missing the timestamp value for thelastmodifieddate GTE filter.
The issue is that we're expecting value for lastmodifieddate to be defined in filters, the value for this operator is after, and initially it's gonna be undefined, with current implementation

return this.db.get("after");

instead of 

return this.db.get("after") || new Date().setDate(new Date().getDate() - 1);

filters: [
                {
                  propertyName: this.property,
                  operator: "HAS_PROPERTY",
                },
                {
                  propertyName: "lastmodifieddate",
                  operator: "GTE",
                  value: after,   <-------------------------------
                },
              ],

To Reproduce
Steps to reproduce the behavior:

  1. Deploy the hubspot-new-contact-property-change component via Pipedream SDK using:
  await pd.triggers.deploy({
    external_user_id: "user_id",
    id: "hubspot-new-contact-property-change",
    configured_props: {
      hubspot: { authProvisionId: "account_id" },
      timer: { intervalSeconds: 60 },
      property: { __lv: { label: "firstname", value: "firstname" } }
    },
    webhook_url: "https://example.com/webhook"
  });
  1. Wait for the trigger to execute or manually test it
  2. Check the execution logs
  3. See error: Invalid input JSON on line 1, column 246: operator GTE requires a value

Expected behavior
The component should initialize properly with a default after parameter and make valid HubSpot API requests with a proper lastmodifieddate GTE filter value.

Screenshots
If applicable, add screenshots to help explain your problem. Note that the screenshots will be displayed publicly.

Additional context
This change likely broke this trigger:
#18294

Tagging:
@dannyroosevelt @michelle0927 @andrewjschuang

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriagedFor maintainers: This issue has been triaged by a Pipedream employee

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions