From e7289523dbfe9be9b764933cfb30ddf44cb5b22c Mon Sep 17 00:00:00 2001 From: mikee-b <112516913+mikee-b@users.noreply.github.com> Date: Thu, 21 May 2026 17:43:21 -0400 Subject: [PATCH] fix(integrations/hubspot): fixed infinite loop (#15208) --- integrations/hubspot/integration.definition.ts | 2 +- .../src/webhook/handlers/oauth-wizard.ts | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/integrations/hubspot/integration.definition.ts b/integrations/hubspot/integration.definition.ts index 5d3b726058a..46eb2b34503 100644 --- a/integrations/hubspot/integration.definition.ts +++ b/integrations/hubspot/integration.definition.ts @@ -6,7 +6,7 @@ export default new IntegrationDefinition({ name: 'hubspot', title: 'HubSpot', description: 'Manage contacts, tickets and more from your chatbot.', - version: '6.0.7', + version: '6.0.8', readme: 'hub.md', icon: 'icon.svg', configuration: { diff --git a/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts b/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts index 16bfabd655c..7f931c38295 100644 --- a/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts +++ b/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts @@ -43,7 +43,23 @@ const HITL_SCOPES = [ 'files', ] -const _startStep: oauthWizard.WizardStepHandler = async ({ client, ctx, query, responses }) => { +const _startStep: oauthWizard.WizardStepHandler = async ({ + client, + ctx, + query, + selectedChoice, + responses, +}) => { + if (selectedChoice) { + await client.setState({ + type: 'integration', + name: 'hitlSetupWizard', + id: ctx.integrationId, + payload: { enableHitl: selectedChoice === 'with-hitl' }, + }) + return responses.redirectToStep('oauth-redirect') + } + const environmentPayload = { source: query.get('source') ?? undefined, env: z.enum(['preview', 'production']).catch('preview').parse(query.get('env')),