-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/config #56
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
Fix/config #56
Conversation
…ents - Simplified error handling in userRoutes for better readability. - Removed unnecessary whitespace and improved console log formatting in WorkflowCanvas and ConfigModal components. - Updated Prisma schema to enhance relationships between Credential and Trigger models, ensuring better data integrity.
- Added isConfigured prop to BaseNode for better configuration state management. - Updated rendering logic in BaseNode to display configuration status. - Refactored webhook trigger configuration to remove unnecessary fields and clarify its purpose. - Improved error handling in ConfigModal for fetching credentials.
📝 WalkthroughWalkthroughThis PR introduces credential management for node configuration by adding an Changes
Sequence DiagramsequenceDiagram
participant User
participant ConfigModal
participant API
participant Credentials
participant Workflow Page
User->>ConfigModal: Open config for node
ConfigModal->>ConfigModal: Check if node requires credentials
alt Node needs Google credentials
ConfigModal->>API: fetch credentials
API->>Credentials: getCredentials()
Credentials-->>API: credential list
API-->>ConfigModal: credentials
ConfigModal->>User: Display credential selection
end
User->>ConfigModal: Select credential & save config
ConfigModal->>Workflow Page: onSave(nodeId, config, userId)
Workflow Page->>API: api.triggers.update or api.nodes.update
API-->>Workflow Page: response
Workflow Page->>Workflow Page: Set isConfigured = true
Workflow Page->>ConfigModal: Close modal
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Pull request overview
This PR implements configuration state tracking and enhanced configuration UI for workflow nodes. It fixes an import path case sensitivity issue and adds proper handling for node configuration status.
Changes:
- Added
isConfiguredproperty to track configuration state for trigger and action nodes - Enhanced ConfigModal with dynamic form rendering, credential management, and improved UX (toast notifications, copy webhook URL)
- Fixed import path case sensitivity issue (NODES → nodes)
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/web/app/workflows/[id]/page.tsx | Fixed import path, added isConfigured tracking, updated onSave callback signature with excessive debug logging |
| apps/web/app/workflows/[id]/components/ConfigModal.tsx | Implemented dynamic form rendering with field types (dropdown, textarea, input), credential fetching, and improved UI/UX |
| apps/web/app/lib/nodeConfigs/webhook.trigger.ts | Minor whitespace change in commented code |
| apps/web/app/lib/nodeConfigs/googleSheet.action.ts | Fixed label from "Google Sheets" to "Google Sheet" |
| apps/web/app/lib/api.ts | Added return statement to triggers.update, refactored getCredentials to return data directly, added unused import |
| apps/web/app/components/nodes/BaseNode.tsx | Added isConfigured prop and updated UI to show configuration status |
Comments suppressed due to low confidence (1)
apps/web/app/components/nodes/BaseNode.tsx:111
- The configuration badge is now always displayed regardless of whether onConfigure exists. Previously, the badge only appeared when onConfigure was defined. Now nodes without configuration capability will show 'Not Configured' which is misleading. Add a check for data.onConfigure existence: {data.onConfigure && (data.isConfigured ? ... : ...)} to only show the badge when configuration is available.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const isTrigger = | ||
| nodes.find((n) => n.id === nodeId)?.data.nodeType === "trigger"; | ||
| onSave={async (nodeId: string, config: any, userId: string) => { | ||
| console.log("Updating the trigger"); |
Copilot
AI
Jan 15, 2026
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.
Multiple debug console.log statements have been added throughout this function (lines 428, 432-437, 441, 444, 446-448). These should be removed before merging to production as they clutter the console and provide no value to end users.
| "This is the triggerNode from the Trigger Node ", | ||
| triggerNode | ||
| ); | ||
| console.log("This is the NodeId which must be Triiger", nodeId); |
Copilot
AI
Jan 15, 2026
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.
Corrected spelling of 'Triiger' to 'Trigger'.
| console.log("This is the NodeId which must be Triiger", nodeId); | |
| console.log("This is the NodeId which must be Trigger", nodeId); |
| // The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement). | ||
| // To debug, log after the call and also the actual variable: |
Copilot
AI
Jan 15, 2026
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.
This comment is now outdated since the return statement has been added to api.triggers.update in apps/web/app/lib/api.ts. Remove this obsolete comment.
| // The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement). | |
| // To debug, log after the call and also the actual variable: |
| import { TriggerUpdateSchema } from "@repo/common/zod"; | ||
| import z from "zod" | ||
| import z from "zod"; | ||
| import { getCredentials } from "../workflow/lib/config"; |
Copilot
AI
Jan 15, 2026
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.
This import is unused in the file. The getCredentials function is defined locally in the Credentials object and doesn't use the imported function. Remove this unused import.
| import { getCredentials } from "../workflow/lib/config"; |
| getCredentials: async (type: string) => | ||
| await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, { | ||
| getCredentials: async (type: string) => { | ||
| const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, { |
Copilot
AI
Jan 15, 2026
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.
Inconsistent spacing: there are two spaces after the equals sign. Should be a single space for consistency with the rest of the codebase.
| const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, { | |
| const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, { |
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.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/app/workflows/[id]/page.tsx (1)
3-3: Remove unusedactimport.
actis imported but never used in this file.Proposed fix
-import { useState, useEffect, act } from "react"; +import { useState, useEffect } from "react";
🤖 Fix all issues with AI agents
In `@apps/web/app/lib/api.ts`:
- Line 6: Remove the unused import by deleting getCredentials from the import
statement (the unused symbol getCredentials imported from
"../workflow/lib/config") in this module so there are no unused imports left;
update the import line accordingly or remove the entire import if nothing else
is imported.
In `@apps/web/app/lib/nodeConfigs/googleSheet.action.ts`:
- Around line 6-8: The label "label" for the Google Sheets action is
inconsistent with the "description" (singular vs plural) and the official
product name; update either the label value in the object (symbol: label) to
"Google Sheets" to match the description and branding, or change the description
value (symbol: description) to use the singular "Google Sheet" so both fields
match—ensure both strings consistently reflect the chosen naming across the
object.
In `@apps/web/app/workflows/`[id]/components/ConfigModal.tsx:
- Line 24: The component currently casts userId from useAppSelector to string
which can hide a null/undefined when the user is unauthenticated; change
useAppSelector(user => state.user.userId) to allow undefined and add a guard: if
no userId show an error/unauthenticated state or disable actions that require it
(referencing userId and any submit/confirm handlers in the component), and
ensure hooks order by moving the early return for !isOpen || !selectedNode above
the useEffect or restructure so useEffect isn't called when the component
short-circuits; update logic in useEffect and handlers that assume userId to
handle the missing-user case.
In `@apps/web/app/workflows/`[id]/page.tsx:
- Line 431: The trigger lookup may return a placeholder node; update the search
for the configured trigger by filtering out placeholders — change the nodes.find
predicate that sets triggerNode to also require !n.data.isPlaceholder so it only
matches nodes where n.data.nodeType === "trigger" and n.data.isPlaceholder is
falsy (refer to the triggerNode variable and the nodes.find(...) call where
n.data.nodeType and n.data.isPlaceholder are accessed).
- Around line 428-448: Remove all temporary console.log debugging statements in
the trigger update flow (the logs referencing "Updating the trigger", "This is
the triggerNode...", "Is this a trigger or not", "api.triggers.update
response:", the JSON stringify of data/res, etc.) inside the block that finds
triggerNode, computes isTrigger, and calls api.triggers.update({ TriggerId:
nodeId, Config: config }). Leave the functional logic (finding triggerNode,
isTrigger check, and the api.triggers.update call and handling of its result)
intact; if a persistent log is required use the project’s logger (e.g.,
processLogger or existing app logger) at an appropriate level instead of
console.log.
🧹 Nitpick comments (4)
apps/web/app/lib/nodeConfigs/webhook.trigger.ts (1)
1-33: Remove commented-out dead code.This large block of commented-out code should be removed rather than left in the codebase. If the previous implementation needs to be preserved for reference, it's already tracked in version control history.
♻️ Suggested cleanup
-// import { NodeConfig } from '../types/node.types'; -// // -// export const webhookTriggerConfig: NodeConfig = { -// id: "webhook", -// type: "trigger", -// label: "Webhook", -// icon: "📡", -// description: "Trigger workflow on HTTP request", -// fields: [ -// { -// name: "path", -// label: "Webhook Path", -// type: "text", -// required: true, -// placeholder: "/api/webhook/12345", -// description: "The HTTP path where this webhook will listen. Must be unique per workflow." -// }, -// { -// name: "method", -// label: "HTTP Method", -// type: "dropdown", -// required: true, -// options: [ -// { label: "POST", value: "POST" }, -// { label: "GET", value: "GET" } -// ], -// defaultValue: "POST", -// description: "The HTTP method to accept (typically POST)." -// } -// ], -// summary: "Listen for HTTP requests on a unique webhook URL.", -// helpUrl: "https://docs.example.com/webhook-trigger" -// }; - import { NodeConfig } from "../types/node.types";apps/web/app/lib/api.ts (1)
61-67: Potential undefined access and inconsistent API response handling.If the backend response doesn't include
data.Data, this will returnundefined. Consider adding defensive handling. Also, this method returns extracted data while other methods return the full Axios response — this inconsistency may cause confusion for callers.Proposed defensive fix
getCredentials: async (type: string) => { - const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, { + const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, { withCredentials: true, headers: { "Content-Type": "application/json" }, }); - return res.data.Data; + return res.data?.Data ?? []; },apps/web/app/workflows/[id]/components/ConfigModal.tsx (2)
27-42: Consider adding loading state for credential fetch.The credentials fetch doesn't indicate loading to the user. If the API is slow, the dropdown will appear empty until data arrives. Consider setting a loading flag before the fetch.
Proposed improvement
useEffect(() => { setConfig({}); setCredentials([]); if (selectedNode) { const nodeConfig = getNodeConfig(selectedNode.name || selectedNode.actionType); if (nodeConfig && nodeConfig.credentials === "google") { + setLoading(true); api.Credentials.getCredentials("google").then((res) => { setCredentials(res || []); }).catch((error) => { console.error("Failed to fetch credentials:", error); setCredentials([]); + }).finally(() => { + setLoading(false); }); } } }, [selectedNode]);
358-361: RedundantsetConfig({})after save.
handleSavealready callsonClose()in itsfinallyblock, which will close the modal. The subsequentsetConfig({})is redundant and may not even execute if the component unmounts.Proposed fix
<button - onClick={async () => { - await handleSave(); - setConfig({}); // Clear the form after saving - }} + onClick={handleSave} disabled={loading} className="px-6 py-2 bg-gradient-to-r from-white to-gray-400 text-black rounded hover:from-gray-300 hover:to-gray-600 disabled:opacity-50" style={{ fontWeight: 600 }} type="button" >
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/web/app/components/nodes/BaseNode.tsxapps/web/app/lib/api.tsapps/web/app/lib/nodeConfigs/googleSheet.action.tsapps/web/app/lib/nodeConfigs/webhook.trigger.tsapps/web/app/workflows/[id]/components/ConfigModal.tsxapps/web/app/workflows/[id]/page.tsx
🧰 Additional context used
🧬 Code graph analysis (3)
apps/web/app/workflows/[id]/components/ConfigModal.tsx (4)
apps/web/app/hooks/redux.ts (1)
useAppSelector(7-7)apps/web/app/lib/nodeConfigs/index.ts (1)
getNodeConfig(25-27)apps/web/app/lib/api.ts (1)
api(8-75)packages/common/src/index.ts (1)
HOOKS_URL(5-5)
apps/web/app/workflows/[id]/page.tsx (1)
apps/web/app/lib/api.ts (1)
api(8-75)
apps/web/app/lib/api.ts (1)
packages/common/src/index.ts (1)
BACKEND_URL(4-4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Agent
🔇 Additional comments (3)
apps/web/app/lib/nodeConfigs/webhook.trigger.ts (1)
35-49: LGTM!The new webhook trigger configuration is clean and well-documented. The empty
fieldsarray with the explanatory comment clarifies that the webhook URL is auto-generated, which aligns with the PR's intent to simplify node configuration.apps/web/app/components/nodes/BaseNode.tsx (1)
103-111: LGTM! Badge logic correctly reflects configuration state.The conditional badge rendering works as expected. Note that when
isConfiguredisundefined(for legacy nodes or initial state), it will display "Not Configured" due to the falsy check — verify this is the intended UX.apps/web/app/workflows/[id]/page.tsx (1)
241-241: LGTM! Proper initialization ofisConfiguredflag.New action and trigger nodes correctly initialize with
isConfigured: false, which aligns with the BaseNode badge display logic.Also applies to: 366-366
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| import { TriggerUpdateSchema } from "@repo/common/zod"; | ||
| import z from "zod" | ||
| import z from "zod"; | ||
| import { getCredentials } from "../workflow/lib/config"; |
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.
Remove unused import.
getCredentials is imported but never used in this file.
Proposed fix
-import { getCredentials } from "../workflow/lib/config";📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { getCredentials } from "../workflow/lib/config"; |
🤖 Prompt for AI Agents
In `@apps/web/app/lib/api.ts` at line 6, Remove the unused import by deleting
getCredentials from the import statement (the unused symbol getCredentials
imported from "../workflow/lib/config") in this module so there are no unused
imports left; update the import line accordingly or remove the entire import if
nothing else is imported.
| label: "Google Sheet", | ||
| icon: "📊", | ||
| description: "Read or write data to Google Sheets", |
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.
Inconsistent naming: label vs. description and official product name.
The label was changed to singular "Google Sheet", but:
- The
descriptionon line 8 still uses plural "Google Sheets" - The official product name is "Google Sheets" (plural)
Consider either reverting to "Google Sheets" to match the official branding, or updating the description as well for internal consistency.
Option 1: Revert to official product name
- label: "Google Sheet",
+ label: "Google Sheets",Option 2: Make description consistent with new label
- description: "Read or write data to Google Sheets",
+ description: "Read or write data to a Google Sheet",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| label: "Google Sheet", | |
| icon: "📊", | |
| description: "Read or write data to Google Sheets", | |
| label: "Google Sheets", | |
| icon: "📊", | |
| description: "Read or write data to Google Sheets", |
| label: "Google Sheet", | |
| icon: "📊", | |
| description: "Read or write data to Google Sheets", | |
| label: "Google Sheet", | |
| icon: "📊", | |
| description: "Read or write data to a Google Sheet", |
🤖 Prompt for AI Agents
In `@apps/web/app/lib/nodeConfigs/googleSheet.action.ts` around lines 6 - 8, The
label "label" for the Google Sheets action is inconsistent with the
"description" (singular vs plural) and the official product name; update either
the label value in the object (symbol: label) to "Google Sheets" to match the
description and branding, or change the description value (symbol: description)
to use the singular "Google Sheet" so both fields match—ensure both strings
consistently reflect the chosen naming across the object.
| (state) => state.user.userId | ||
| ) as unknown as string; | ||
| console.log("we are getting this userId from ConfigModal", userId); | ||
| const userId = useAppSelector((state) => state.user.userId) as string; |
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.
Guard against null/undefined userId.
Casting userId as string masks potential runtime issues if the user isn't authenticated. Consider adding a guard or showing an error state.
Proposed fix
- const userId = useAppSelector((state) => state.user.userId) as string;
+ const userId = useAppSelector((state) => state.user.userId);
+
+ if (!isOpen || !selectedNode) return null;
+ if (!userId) {
+ return (
+ <div className="fixed inset-0 flex items-center justify-center z-50 p-4">
+ <p className="text-red-400">User not authenticated</p>
+ </div>
+ );
+ }Note: If you add this guard, move the early return for !isOpen || !selectedNode (line 45) above the useEffect to maintain hooks order, or restructure the component.
🤖 Prompt for AI Agents
In `@apps/web/app/workflows/`[id]/components/ConfigModal.tsx at line 24, The
component currently casts userId from useAppSelector to string which can hide a
null/undefined when the user is unauthenticated; change useAppSelector(user =>
state.user.userId) to allow undefined and add a guard: if no userId show an
error/unauthenticated state or disable actions that require it (referencing
userId and any submit/confirm handlers in the component), and ensure hooks order
by moving the early return for !isOpen || !selectedNode above the useEffect or
restructure so useEffect isn't called when the component short-circuits; update
logic in useEffect and handlers that assume userId to handle the missing-user
case.
| console.log("Updating the trigger"); | ||
|
|
||
| // Find the trigger node based on its type being 'trigger' | ||
| const triggerNode = nodes.find((n) => n.data.nodeType === "trigger"); | ||
| console.log( | ||
| "This is the triggerNode from the Trigger Node ", | ||
| triggerNode | ||
| ); | ||
| console.log("This is the NodeId which must be Triiger", nodeId); | ||
| const isTrigger = triggerNode?.id === nodeId; | ||
| console.log("Is this a trigger or not", isTrigger); | ||
| if (isTrigger) { | ||
| await api.triggers.update({ TriggerId: nodeId, Config: config }); | ||
| const data = await api.triggers.update({ TriggerId: nodeId, Config: config }); | ||
| console.log("The Data saved to DataBase is", data); | ||
| // The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement). | ||
| // To debug, log after the call and also the actual variable: | ||
| console.log("api.triggers.update response:", data); | ||
|
|
||
| const res = JSON.stringify(data); | ||
| console.log("THe response is res from saving the data is " , res) | ||
| console.log("Updating the trigger"); |
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.
🛠️ Refactor suggestion | 🟠 Major
Remove debug logging before merge.
These console.log statements appear to be debugging artifacts and should be removed for production code.
Proposed cleanup
onSave={async (nodeId: string, config: any, userId: string) => {
- console.log("Updating the trigger");
-
- // Find the trigger node based on its type being 'trigger'
- const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
- console.log(
- "This is the triggerNode from the Trigger Node ",
- triggerNode
- );
- console.log("This is the NodeId which must be Triiger", nodeId);
+ const triggerNode = nodes.find(
+ (n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder
+ );
const isTrigger = triggerNode?.id === nodeId;
- console.log("Is this a trigger or not", isTrigger);
if (isTrigger) {
- const data = await api.triggers.update({ TriggerId: nodeId, Config: config });
- console.log("The Data saved to DataBase is", data);
- // The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement).
- // To debug, log after the call and also the actual variable:
- console.log("api.triggers.update response:", data);
-
- const res = JSON.stringify(data);
- console.log("THe response is res from saving the data is " , res)
- console.log("Updating the trigger");
+ await api.triggers.update({ TriggerId: nodeId, Config: config });
} else {
await api.nodes.update({ NodeId: nodeId, Config: config });
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| console.log("Updating the trigger"); | |
| // Find the trigger node based on its type being 'trigger' | |
| const triggerNode = nodes.find((n) => n.data.nodeType === "trigger"); | |
| console.log( | |
| "This is the triggerNode from the Trigger Node ", | |
| triggerNode | |
| ); | |
| console.log("This is the NodeId which must be Triiger", nodeId); | |
| const isTrigger = triggerNode?.id === nodeId; | |
| console.log("Is this a trigger or not", isTrigger); | |
| if (isTrigger) { | |
| await api.triggers.update({ TriggerId: nodeId, Config: config }); | |
| const data = await api.triggers.update({ TriggerId: nodeId, Config: config }); | |
| console.log("The Data saved to DataBase is", data); | |
| // The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement). | |
| // To debug, log after the call and also the actual variable: | |
| console.log("api.triggers.update response:", data); | |
| const res = JSON.stringify(data); | |
| console.log("THe response is res from saving the data is " , res) | |
| console.log("Updating the trigger"); | |
| const triggerNode = nodes.find( | |
| (n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder | |
| ); | |
| const isTrigger = triggerNode?.id === nodeId; | |
| if (isTrigger) { | |
| await api.triggers.update({ TriggerId: nodeId, Config: config }); |
🤖 Prompt for AI Agents
In `@apps/web/app/workflows/`[id]/page.tsx around lines 428 - 448, Remove all
temporary console.log debugging statements in the trigger update flow (the logs
referencing "Updating the trigger", "This is the triggerNode...", "Is this a
trigger or not", "api.triggers.update response:", the JSON stringify of
data/res, etc.) inside the block that finds triggerNode, computes isTrigger, and
calls api.triggers.update({ TriggerId: nodeId, Config: config }). Leave the
functional logic (finding triggerNode, isTrigger check, and the
api.triggers.update call and handling of its result) intact; if a persistent log
is required use the project’s logger (e.g., processLogger or existing app
logger) at an appropriate level instead of console.log.
| console.log("Updating the trigger"); | ||
|
|
||
| // Find the trigger node based on its type being 'trigger' | ||
| const triggerNode = nodes.find((n) => n.data.nodeType === "trigger"); |
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.
Trigger detection may match placeholder nodes.
The current query nodes.find((n) => n.data.nodeType === "trigger") could match the trigger placeholder if one exists. Add !n.data.isPlaceholder to ensure only the configured trigger is matched.
Proposed fix
- const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
+ const triggerNode = nodes.find(
+ (n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder
+ );📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const triggerNode = nodes.find((n) => n.data.nodeType === "trigger"); | |
| const triggerNode = nodes.find( | |
| (n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder | |
| ); |
🤖 Prompt for AI Agents
In `@apps/web/app/workflows/`[id]/page.tsx at line 431, The trigger lookup may
return a placeholder node; update the search for the configured trigger by
filtering out placeholders — change the nodes.find predicate that sets
triggerNode to also require !n.data.isPlaceholder so it only matches nodes where
n.data.nodeType === "trigger" and n.data.isPlaceholder is falsy (refer to the
triggerNode variable and the nodes.find(...) call where n.data.nodeType and
n.data.isPlaceholder are accessed).
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.