-
Notifications
You must be signed in to change notification settings - Fork 3.3k
v0.3.26: fix billing, bubble up workflow block errors, credentials security improvements #967
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
Changes from 2 commits
ac41bf8
f1934fe
fd9e61f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import { HelpCircle, LibraryBig, ScrollText, Search, Settings, Shapes } from 'lu | |||||
| import { useParams, usePathname, useRouter } from 'next/navigation' | ||||||
| import { Button, ScrollArea, Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui' | ||||||
| import { useSession } from '@/lib/auth-client' | ||||||
| import { isBillingEnabled } from '@/lib/environment' | ||||||
| import { getEnv } from '@/lib/env' | ||||||
| import { createLogger } from '@/lib/logs/console/logger' | ||||||
| import { generateWorkspaceName } from '@/lib/naming' | ||||||
| import { cn } from '@/lib/utils' | ||||||
|
|
@@ -195,6 +195,9 @@ export function Sidebar() { | |||||
| const userPermissions = useUserPermissionsContext() | ||||||
| const isLoading = workflowsLoading || sessionLoading | ||||||
|
|
||||||
| // Get billing status | ||||||
| const isBillingEnabled = getEnv('NEXT_PUBLIC_BILLING_ENABLED') || false | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Type safety concern:
Suggested change
|
||||||
|
|
||||||
| // Add state to prevent multiple simultaneous workflow creations | ||||||
| const [isCreatingWorkflow, setIsCreatingWorkflow] = useState(false) | ||||||
| // Add state to prevent multiple simultaneous workspace creations | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,6 +115,12 @@ export class WorkflowBlockHandler implements BlockHandler { | |
| duration | ||
| ) | ||
|
|
||
| // If the child workflow failed, throw an error to trigger proper error handling in the parent | ||
| if ((mappedResult as any).success === false) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Type assertion to Context Used: Context - Avoid using type assertions to 'any' in TypeScript. Instead, ensure proper type definitions are used to maintain type safety. (link) |
||
| const childError = (mappedResult as any).error || 'Unknown error' | ||
| throw new Error(`Error in child workflow "${childWorkflowName}": ${childError}`) | ||
| } | ||
|
|
||
| return mappedResult | ||
| } catch (error: any) { | ||
| logger.error(`Error executing child workflow ${workflowId}:`, error) | ||
|
|
@@ -128,11 +134,15 @@ export class WorkflowBlockHandler implements BlockHandler { | |
| const workflowMetadata = workflows[workflowId] | ||
| const childWorkflowName = workflowMetadata?.name || workflowId | ||
|
|
||
| return { | ||
| success: false, | ||
| error: error?.message || 'Child workflow execution failed', | ||
| childWorkflowName, | ||
| } as Record<string, any> | ||
| // Enhance error message with child workflow context | ||
| const originalError = error.message || 'Unknown error' | ||
|
|
||
| // Check if error message already has child workflow context to avoid duplication | ||
| if (originalError.startsWith('Error in child workflow')) { | ||
| throw error // Re-throw as-is to avoid duplication | ||
| } | ||
|
|
||
| throw new Error(`Error in child workflow "${childWorkflowName}": ${originalError}`) | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
logic:
getEnvreturnsstring | undefinedbut you're using|| falsewhich could result in truthy strings like 'false' being treated astrue. Consider using theisTruthyutility from@/lib/envfor proper boolean conversion.