fix(change-detection): move change detection logic to client-side to prevent unnecessary API calls, consolidate utils#2576
Merged
waleedlatif1 merged 4 commits intostagingfrom Dec 25, 2025
Merged
Conversation
…prevent unnecessary API calls, consolidate utils
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
ea0536e to
f7efcf1
Compare
Contributor
Greptile SummaryRefactored workflow change detection from server-side API calls to client-side computation, eliminating unnecessary network requests and improving performance. Key Changes:
Benefits:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant DeployPanel as Deploy Panel UI
participant Hook as useChangeDetection Hook
participant Store as Zustand Stores
participant Compare as hasWorkflowChanged
participant API as Status/Deploy API
Note over User,API: BEFORE: API-based change detection
User->>DeployPanel: View deployment status
DeployPanel->>Hook: Initialize (old)
Hook->>Store: Subscribe to workflow changes
Hook->>API: POST /api/workflows/[id]/status
API->>API: Load from normalized tables
API->>Compare: hasWorkflowChanged()
API-->>Hook: { needsRedeployment: true/false }
Hook-->>DeployPanel: Show redeployment badge
Note over User,API: AFTER: Client-side change detection
User->>DeployPanel: View deployment status
DeployPanel->>Hook: Initialize (new)
Hook->>Store: Subscribe to blocks, edges, loops, parallels
Hook->>Hook: Build currentState with subBlocks
Hook->>Compare: hasWorkflowChanged(current, deployed)
Compare->>Compare: Normalize & compare edges, blocks, loops, parallels
Compare-->>Hook: true/false
Hook-->>DeployPanel: Show redeployment badge (no API call)
Note over API: API still uses hasWorkflowChanged for server-side checks
DeployPanel->>API: POST /api/workflows/[id]/deploy
API->>Compare: hasWorkflowChanged()
API-->>DeployPanel: Deployment result
|
Contributor
There was a problem hiding this comment.
Additional Comments (1)
-
apps/sim/app/api/workflows/[id]/status/route.ts, line 39 (link)logic: Inconsistent API response:
isPublishedfield is only included in the early return case but missing from the main response on line 69-73Should
isPublishedbe included in both response objects for API consistency?
10 files reviewed, 2 comments
Collaborator
Author
|
@greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
Tested manually, added tests
Checklist