Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.3",
"@tanstack/react-query": "^4.36.1",
"@useparagon/connect": "2.1.1",
"@useparagon/connect": "2.1.2-experimental.13",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ActionButton } from './components/action-button';
import { WorkflowSection } from './components/workflows';
import { IntegrationSettingsSection } from './components/integration-settings';
import { ErrorMessage } from '../error-message';
import { Button } from '@/components/ui/button';

const globalInstallationErrors = new Set<InstallFlowError['name']>([
'OAuthBlockedError',
Expand Down Expand Up @@ -71,7 +72,7 @@ export function IntegrationModal(props: Props) {
setInstallationError(null);
setIsInstalling(true);
paragon.installFlow.start(props.integration, {
oauthTimeout: 45_000,
oauthTimeout: 2 * 60 * 1000,
onNext: (next) => {
setShowFlowForm(!next.done);
setInstallFlowStage(next);
Expand All @@ -82,6 +83,10 @@ export function IntegrationModal(props: Props) {
setInstallFlowStage(null);
},
onError: (error, errorContext) => {
console.error('InstallFlow error:', {
integration: props.integration,
error,
});
setIsInstalling(false);
setInstallationError({
stage: errorContext?.stage,
Expand All @@ -106,6 +111,15 @@ export function IntegrationModal(props: Props) {
});
};

const doCancel = async () => {
await paragon.installFlow.cancel();
setShowFlowForm(false);
setIsInstalling(false);
setInstallFlowStage(null);
setInstallationError(null);
setTab('overview');
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Cancel Flow Error Handling

The doCancel function lacks error handling for paragon.installFlow.cancel(). If the cancellation fails, the subsequent UI state reset doesn't occur, leaving the component in an inconsistent "installing" state.

Fix in Cursor Fix in Web


if (isLoading) {
return null;
}
Expand All @@ -128,12 +142,24 @@ export function IntegrationModal(props: Props) {
</DialogDescription>
</div>
</div>
<ActionButton
status={props.status}
isInstalling={isInstalling}
onDisconnect={doDisable}
onConnect={doEnable}
/>
<div className="flex gap-2">
<ActionButton
status={props.status}
isInstalling={isInstalling}
onDisconnect={doDisable}
onConnect={doEnable}
/>
{isInstalling && (
<Button
className="cursor-pointer"
size="sm"
variant="link"
onClick={doCancel}
>
Cancel
</Button>
)}
</div>
</div>
</DialogHeader>
<div className="pt-6 px-1 overflow-y-auto max-h-[70dvh]">
Expand Down
Loading