Skip to content

Conversation

@andrewjschuang
Copy link
Contributor

@andrewjschuang andrewjschuang commented Sep 5, 2025

WHY

When there are too many contacts, the timer can fail with a timeout error in the first poll.

Summary by CodeRabbit

  • New Features

    • HubSpot “New or Updated Contact” source now supports selecting additional contact properties.
    • Smarter incremental sync: automatically uses created or last modified date based on mode, improving accuracy.
    • Faster initial import with a higher first-run batch size.
  • Chores

    • Bumped HubSpot component versions for the source and package to the latest patch releases.

@vercel
Copy link

vercel bot commented Sep 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 5, 2025 1:53pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 5, 2025 1:53pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The HubSpot component version is bumped. In the new-or-updated-contact source, the version increments and getParams now accepts an after argument, computes dateProperty based on newOnly, adjusts first-run behavior via DB state, builds dynamic properties, and conditionally adds filterGroups for incremental fetches.

Changes

Cohort / File(s) Summary
Metadata version bump
components/hubspot/package.json
Incremented package version from 1.6.2 to 1.6.3. No other metadata changes.
HubSpot contact source param construction
components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs
Version 0.0.14 → 0.0.15. getParams()getParams(after). Computes dateProperty from newOnly (createdate vs lastmodifieddate). Determines isFirstRun via this.db.get("after"). On first run sets limit=100, otherwise DEFAULT_LIMIT. Uses computed dateProperty in sorts. Merges DEFAULT_CONTACT_PROPERTIES with this.properties. Adds filterGroups when after is provided. Returns constructed params.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Scheduler as Trigger
  participant Source as NewOrUpdatedContact Source
  participant DB as State DB
  participant HubSpot as HubSpot CRM API

  Scheduler->>Source: run()
  Source->>DB: get("after")
  DB-->>Source: after | null
  alt First run (after == null)
    Note right of Source: isFirstRun = true<br/>limit = 100<br/>dateProperty = createdate | lastmodifieddate
    Source->>HubSpot: GET /contacts with params<br/>sort by dateProperty ASC<br/>properties = default + extras
  else Incremental run
    Note right of Source: isFirstRun = false<br/>limit = DEFAULT_LIMIT<br/>filterGroups: dateProperty > after
    Source->>HubSpot: GET /contacts with params<br/>filter on dateProperty > after
  end
  HubSpot-->>Source: contacts batch
  Source-->>Scheduler: emit records
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I twitch my whiskers, versions hop—
A tiny bump, a cleaner stop.
Dates now guide the trails I seek,
First-run bounds, then steady streak.
Properties packed, filters tight—
I fetch by moon and morning light.
Thump-thump: the contacts are just right.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e3d9866 and 03c6193.

📒 Files selected for processing (2)
  • components/hubspot/package.json (1 hunks)
  • components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hubspot-contacts-limit-on-first-run

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@andrewjschuang andrewjschuang merged commit fbc56f0 into master Sep 5, 2025
9 of 10 checks passed
@andrewjschuang andrewjschuang deleted the hubspot-contacts-limit-on-first-run branch September 5, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants