- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
Hubspot New Deal in Stage - limit initial events #18469
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
Conversation
| The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
 | 
| WalkthroughUpdates HubSpot component version and refactors the “New Deal in Stage” source to query all selected stages in one request using an IN filter, adds a cap on initial event emissions, adjusts pagination/control flow for first-run behavior, and bumps the source version. Changes
 Sequence Diagram(s)sequenceDiagram
  autonumber
  actor User as User Setup
  participant Src as HubSpot Source
  participant HS as HubSpot API
  User->>Src: Create "New Deal in Stage" source
  Note over Src: First run (after = undefined)
  Src->>Src: getAllStagesParams(undefined)<br/>dealstage IN selected stages<br/>sort by hs_lastmodifieddate DESC
  Src->>HS: Search deals (IN filter)
  HS-->>Src: Results (paged)
  loop Process results
    Src->>Src: Emit up to MAX_INITIAL_EVENTS
    alt Cap reached
      Src-->>Src: Stop initial run early
    else Not reached
      Src->>HS: Next page (if any)
      HS-->>Src: More results
    end
  end
  Note over Src: Subsequent runs (after set)
  Src->>Src: getAllStagesParams(after)<br/>dealstage IN + hs_lastmodifieddate > after
  Src->>HS: Search deals (filtered by after)
  HS-->>Src: Results
  Src->>Src: Evaluate relevance and emit events
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
 Suggested reviewers
 Poem
 Pre-merge checks and finishing touches❌ Failed checks (1 warning)
 ✅ Passed checks (4 passed)
 ✨ Finishing touches
 🧪 Generate unit tests
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
 🧰 Additional context used🧬 Code graph analysis (1)components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs (2)
 ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
 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. Comment  | 
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
- components/hubspot/package.json(1 hunks)
- components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs (1)
components/hubspot/sources/common/common.mjs (2)
params(190-190)
after(189-189)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (1)
components/hubspot/package.json (1)
3-3: Patch version bump LGTMIncrementing to 1.7.11 matches the scoped change set and keeps semantic versioning intact.
        
          
                components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      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.
LGTM!
| /approve | 
Closes #18416
This limits the events emitted when
tsis falsy, i.e. on initial event emission.Summary by CodeRabbit
Bug Fixes
Chores