- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
Hubspot - bug fix to retrieve-workflows #18433
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
 | 
| WalkthroughThe HubSpot retrieve-workflows action version is incremented and its summary computation is made nil-safe; the HubSpot package version is bumped. No other functional changes are present. Changes
 Sequence Diagram(s)sequenceDiagram
  autonumber
  participant U as User
  participant A as Retrieve Workflows Action
  participant H as HubSpot API
  U->>A: Invoke action
  A->>H: GET /workflows
  H-->>A: Response (may include `results` or omit it / return error)
  alt results present
    A->>A: summary = response?.results?.length ?? 0
    A-->>U: Return data + summary
  else results missing or undefined
    A->>A: summary = 0 (default)
    A-->>U: Return data/error without TypeError
  end
  note over A: Optional chaining prevents reading `length` of undefined
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
 Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
 ✅ Passed checks (3 passed)
 ✨ Finishing touches🧪 Generate unit tests
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
 🚧 Files skipped from review as they are similar to previous changes (1)
 ⏰ 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). (3)
 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: 0
🧹 Nitpick comments (2)
components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (2)
16-16: Defensive null checks and clearer summary.Guard
responseas well, and avoid||for numeric 0. Also fix singular/plural.Apply this diff:
- $.export("$summary", `Successfully retrieved ${response.results?.length || 0} workflows`); + const count = Array.isArray(response?.results) ? response.results.length : 0; + $.export("$summary", `Successfully retrieved ${count} workflow${count === 1 ? "" : "s"}`);
12-18: Surface upstream errors in summary and preserve stack.Wrap the call to expose HubSpot error details and avoid masking failures.
Apply this diff:
async run({ $ }) { - const response = await this.hubspot.listWorkflows({ - $, - }); - $.export("$summary", `Successfully retrieved ${response.results?.length || 0} workflows`); - return response; + try { + const response = await this.hubspot.listWorkflows({ $ }); + const count = Array.isArray(response?.results) ? response.results.length : 0; + $.export("$summary", `Successfully retrieved ${count} workflow${count === 1 ? "" : "s"}`); + return response; + } catch (err) { + const msg = err?.response?.data?.message || err?.message || "Unknown error"; + $.export("$summary", `Failed to retrieve workflows: ${msg}`); + throw err; + } },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
- components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs(2 hunks)
- components/hubspot/package.json(1 hunks)
⏰ 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: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
🔇 Additional comments (2)
components/hubspot/package.json (1)
3-3: Patch version bump LGTM (1.7.7).Appropriate patch-level increment for a bug fix; no further concerns.
components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (1)
7-7: Action version bump LGTM (0.0.3).Consistent with a non‑breaking bug fix.
| /approve | 
Resolves #18424
Summary by CodeRabbit
Bug Fixes
Chores