fix(hubspot): selector fetchOptions default + credentialId validation#4723
Conversation
useSubBlockStore.getValue returns null for default-valued dropdowns until the user interacts with them. The properties, pipelines, stages, and ownerId selectors were treating that as "no selection" and short-circuiting, so the dropdowns appeared empty even though the trigger uses 'contact' as the visible default. Adds resolveSelectedObjectType to mirror the rendered default, so the selectors fire on first paint with a valid objectType. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Mirrors the Gmail/Webflow/Jira selector route security pattern by rejecting non-alphanumeric credentialId values before authorization or token refresh. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Fixes HubSpot polling trigger dropdowns to resolve the effective Reviewed by Cursor Bugbot for commit 45cbd18. Configure here. |
Greptile SummaryThis PR fixes two related issues in the HubSpot trigger: (1) property/pipeline/owner dropdowns on first render were empty because
Confidence Score: 5/5Safe to merge — targeted bug fixes with no regressions identified. The changes are well-scoped: the resolveSelectedObjectType helper correctly centralises the null→'contact' default and the custom-object branch, and the four API routes now validate credentialId early in a pattern already established by other integrations. UUIDs (the actual credential ID format) pass validateAlphanumericId without issue. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(hubspot): use resolveSelectedObjectT..." | Re-trigger Greptile |
…chOptions Both selectors used inline `?? 'contact'` fallbacks while properties and targetPropertyName already routed through the resolver. Switch to the shared helper so custom-object handling stays consistent across every cascading selector. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 45cbd18. Configure here.
Summary
objectTypedefault ('contact') in trigger selectorfetchOptionsso the properties/pipelines/stages/ownerId dropdowns populate on first paint instead of waiting for the user to re-pick the default.credentialIdwithvalidateAlphanumericIdin the 4 HubSpot selector routes (properties, lists, pipelines, owners), matching the Gmail/Webflow/Jira security pattern.Type of Change
Testing
Tested manually — properties dropdown now populates immediately after selecting a credential. Type-check,
check:api-validation, and lint-staged biome all pass.Checklist