fix: removed more debugging

This commit is contained in:
Adam Gough
2025-05-17 23:07:22 -04:00
parent 8e6101b0e3
commit d024f8da89
4 changed files with 1 additions and 76 deletions

View File

@@ -32,46 +32,6 @@ export function DeployedWorkflowCard({
}: DeployedWorkflowCardProps) {
const [showingDeployed, setShowingDeployed] = useState(true)
const workflowToShow = showingDeployed ? deployedWorkflowState : currentWorkflowState
console.log('workflowToShow', workflowToShow)
// Add detailed logging for debugging
useEffect(() => {
if (workflowToShow) {
// Log basic stats
const blockCount = Object.keys(workflowToShow.blocks || {}).length;
const blocksWithSubBlocks = Object.values(workflowToShow.blocks || {})
.filter(block => block.subBlocks && Object.keys(block.subBlocks).length > 0);
logger.info(`[WORKFLOW-STATE] ${showingDeployed ? 'Deployed' : 'Current'} workflow with ${blockCount} blocks`, {
type: showingDeployed ? 'deployed' : 'current',
blockCount,
blocksWithSubBlocksCount: blocksWithSubBlocks.length,
// Log a sample of a block with subblocks if any exist
sampleBlock: blocksWithSubBlocks.length > 0
? {
id: blocksWithSubBlocks[0].id,
type: blocksWithSubBlocks[0].type,
subBlocksCount: Object.keys(blocksWithSubBlocks[0].subBlocks || {}).length,
subBlocksSample: Object.entries(blocksWithSubBlocks[0].subBlocks || {}).slice(0, 2)
}
: null
});
// For deep debug, log each block's subblocks (limited data for readability)
Object.entries(workflowToShow.blocks || {}).forEach(([blockId, block]) => {
if (block.subBlocks && Object.keys(block.subBlocks).length > 0) {
logger.info(`[BLOCK-SUBBLOCKS] ${showingDeployed ? 'Deployed' : 'Current'} block ${blockId}`, {
blockId,
blockType: block.type,
subBlocksCount: Object.keys(block.subBlocks).length,
// Just log IDs to avoid huge logs, but include a couple of values as examples
subBlockIds: Object.keys(block.subBlocks),
sampleValues: Object.entries(block.subBlocks).slice(0, 2).map(([id, value]) => ({ id, value }))
});
}
});
}
}, [workflowToShow, showingDeployed]);
// Create sanitized workflow state
const sanitizedWorkflowState = useMemo(() => {
@@ -98,8 +58,6 @@ export function DeployedWorkflowCard({
return `${showingDeployed ? 'deployed' : 'current'}-preview-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
}, [showingDeployed]);
{console.log('sanitizedWorkflowState', sanitizedWorkflowState)}
return (
<Card className={cn('relative overflow-hidden', className)}>
<CardHeader

View File

@@ -1,6 +1,6 @@
'use client'
import { useEffect, useState, useMemo } from 'react'
import { useState, useMemo } from 'react'
import {
AlertDialog,
AlertDialogAction,
@@ -53,17 +53,6 @@ export function DeployedWorkflowModal({
const { revertToDeployedState } = useWorkflowStore()
const activeWorkflowId = useWorkflowRegistry((state) => state.activeWorkflowId)
// Add debug logging to check deployedWorkflowState
useEffect(() => {
if (isOpen) {
if (deployedWorkflowState) {
logger.info(`DeployedWorkflowModal received state with ${Object.keys(deployedWorkflowState.blocks || {}).length} blocks`)
} else {
logger.warn('DeployedWorkflowModal opened but deployedWorkflowState is null or undefined')
}
}
}, [isOpen, deployedWorkflowState]);
// Get current workflow state to compare with deployed state
const currentWorkflowState = useWorkflowStore((state) => ({
blocks: activeWorkflowId ? mergeSubblockState(state.blocks, activeWorkflowId) : state.blocks,

View File

@@ -511,17 +511,6 @@ export function ConditionInput({ blockId, subBlockId, isConnecting, isPreview =
})
}, [conditionalBlocks.length])
// Log when in preview mode to verify it's working
// useEffect(() => {
// if (isPreview) {
// logger.info(`[PREVIEW] ConditionInput for ${blockId}:${subBlockId}`, {
// isPreview,
// propValue,
// storeValue
// });
// }
// }, [isPreview, propValue, storeValue, blockId, subBlockId]);
// Show loading or empty state if not ready or no blocks
if (!isReady || conditionalBlocks.length === 0) {
return (

View File

@@ -33,17 +33,6 @@ export function Dropdown({
const [value, setValue] = useSubBlockValue<string>(blockId, subBlockId, true, isPreview, propValue)
const [storeInitialized, setStoreInitialized] = useState(false)
// Log when in preview mode to verify it's working
useEffect(() => {
if (isPreview) {
logger.info(`[PREVIEW] Dropdown for ${blockId}:${subBlockId}`, {
isPreview,
propValue,
value
});
}
}, [isPreview, propValue, value, blockId, subBlockId]);
// Evaluate options if it's a function
const evaluatedOptions = useMemo(() => {
return typeof options === 'function' ? options() : options