-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(debug-mode): remove duplicate debug mode flag #1714
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
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
isDebugModeEnabledfrom general settings store and replaced all usages withisDebuggingfrom 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())
8 files reviewed, no comments
* 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)
Summary
Remove duplicate tracking of debug mode causing browser cache issues.
Type of Change
Testing
Tested manually
Checklist