Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Remove duplicate tracking of debug mode causing browser cache issues.

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 22, 2025 10:47am

@icecrasher321 icecrasher321 merged commit 989a772 into staging Oct 22, 2025
9 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Summary

Consolidated debug mode state management into the execution store, eliminating duplicate tracking in the general settings store. This resolves browser cache issues caused by the redundant state.

Key Changes:

  • Removed isDebugModeEnabled from general settings store and replaced all usages with isDebugging from execution store
  • Removed automatic toggling of debug mode flag in control bar - debug state is now managed directly via setIsDebugging(true) when starting debug execution
  • Simplified execution completion logic by removing conditional checks for debug mode state
  • Updated executor to read debug state from execution store instead of general store
  • Updated all tests and mocks to reflect the new state location

Impact:
The change consolidates debug state into a single source of truth, making the system more predictable and eliminating potential sync issues between the two stores that could cause browser cache problems.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring is well-executed with consistent changes across all affected files. Debug state is properly consolidated into execution store, all references are updated correctly, and tests are updated to match. The logic flow remains unchanged - only the source of truth for debug state has moved.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/stores/settings/general/store.ts 5/5 Removed isDebugModeEnabled state and toggleDebugMode action as debug state moved to execution store
apps/sim/executor/index.ts 5/5 Changed debug mode detection from useGeneralStore to useExecutionStore.getState().isDebugging
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts 5/5 Removed duplicate debug mode tracking; removed auto-reset of general store debug mode; simplified execution completion logic
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/control-bar.tsx 5/5 Removed redundant isDebugModeEnabled checks and auto-toggle logic when starting debug mode

Sequence Diagram

sequenceDiagram
    participant User
    participant ControlBar
    participant useWorkflowExecution
    participant ExecutionStore
    participant Executor
    participant Workflow

    User->>ControlBar: Click Debug Button
    ControlBar->>ControlBar: Check if debugging
    alt Not Debugging
        ControlBar->>useWorkflowExecution: handleRunWorkflow(undefined, true)
        useWorkflowExecution->>ExecutionStore: setIsExecuting(true)
        useWorkflowExecution->>ExecutionStore: setIsDebugging(true)
        useWorkflowExecution->>Executor: new Executor()
        Executor->>ExecutionStore: getState().isDebugging
        Note over Executor: isDebugging = true
        useWorkflowExecution->>ExecutionStore: setPendingBlocks([...])
        ExecutionStore->>Workflow: Notify state change
        Workflow->>Workflow: Render pending blocks (isDebugging && pendingBlocks)
    else Already Debugging
        ControlBar->>useWorkflowExecution: handleCancelDebug()
        useWorkflowExecution->>ExecutionStore: reset()
        ExecutionStore->>Workflow: Notify state change
    end
    
    User->>ControlBar: Click Step/Resume
    ControlBar->>useWorkflowExecution: handleStepDebug() / handleResumeDebug()
    useWorkflowExecution->>Executor: executeNext()
    Executor->>ExecutionStore: setActiveBlocks()
    
    Executor->>useWorkflowExecution: Execution complete
    useWorkflowExecution->>ExecutionStore: setIsExecuting(false)
    useWorkflowExecution->>ExecutionStore: setIsDebugging(false)
    useWorkflowExecution->>ExecutionStore: setActiveBlocks(new Set())
Loading

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

waleedlatif1 added a commit that referenced this pull request Oct 23, 2025
* fix(debug-mode): remove duplicate debug mode flag (#1714)

* feat(i18n): update translations (#1709)

* improvement(condition): added variable and envvar highlighting for condition input (#1718)

* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data (#1719)

* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data

* apps/sim

* renaming

* remove relative import

* feat(tools): added webflow OAuth + tools (#1720)

* feat(tools): added webflow OAuth + tools

* remove itemId from delete item

* remove siteId

* added webhook triggers + oauth scopes + site/collection selector

* update sample payload for webflow triggers

* cleanup

* fix discord color

* feat(i18n): update translations (#1721)

* improvement(schedule): fix UI bug with schedule modal (#1722)
@waleedlatif1 waleedlatif1 deleted the fix/duplicate-is-debug-flag branch November 6, 2025 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants