-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Split record crud actions #8930
Conversation
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.
PR Summary
This PR splits the previously unified record CRUD actions into separate specialized actions for better code organization and reduced complexity.
- Splits
RECORD_CRUD
into distinctCREATE_RECORD
,UPDATE_RECORD
,DELETE_RECORD
, andFIND_RECORD
action types in/packages/twenty-front/src/modules/workflow/types/Workflow.ts
- Removes utility functions like
isWorkflowRecordCreateAction
in favor of direct action type checks - Adds dedicated workflow action classes like
CreateRecordWorkflowAction
andUpdateRecordWorkflowAction
in/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/record-crud/
- Updates
WorkflowActionFactory
andWorkflowBuilderWorkspaceService
to handle the new separate action types ⚠️ Breaking change that requires migration of existing workflows using the previous combinedRECORD_CRUD
action type
25 file(s) reviewed, 18 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-front/src/modules/workflow/components/WorkflowStepDetail.tsx
Show resolved
Hide resolved
packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeBase.tsx
Show resolved
Hide resolved
...les/workflow/workflow-executor/workflow-actions/record-crud/delete-record.workflow-action.ts
Show resolved
Hide resolved
...server/src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type.ts
Outdated
Show resolved
Hide resolved
await repository.update(workflowActionInput.objectRecordId, { | ||
...workflowActionInput.objectRecord, | ||
}); |
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.
logic: potential race condition between findOne and update - record could be deleted between these operations
...les/workflow/workflow-executor/workflow-actions/record-crud/update-record.workflow-action.ts
Show resolved
Hide resolved
...les/workflow/workflow-executor/workflow-actions/record-crud/update-record.workflow-action.ts
Show resolved
Hide resolved
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.
Love it 😍
Having a global record crud action adds complex logic.
We decided to split those actions. I only kept a common folder / module in backend.