fix(core): revert blocking workflow update on interim change (#4437)
⏪ Revert "feat(core): block workflow update on interim change (#4397)"
This reverts commit cddd012a2f.
This commit is contained in:
7
packages/cli/src/requests.d.ts
vendored
7
packages/cli/src/requests.d.ts
vendored
@@ -56,12 +56,7 @@ export declare namespace WorkflowRequest {
|
||||
|
||||
type Delete = Get;
|
||||
|
||||
type Update = AuthenticatedRequest<
|
||||
{ id: string },
|
||||
{},
|
||||
RequestBody & { updatedAt: string },
|
||||
{ forceSave?: string }
|
||||
>;
|
||||
type Update = AuthenticatedRequest<{ id: string }, {}, RequestBody>;
|
||||
|
||||
type NewName = AuthenticatedRequest<{}, {}, {}, { name?: string }>;
|
||||
|
||||
|
||||
@@ -329,7 +329,6 @@ workflowsController.patch(
|
||||
`/:id`,
|
||||
ResponseHelper.send(async (req: WorkflowRequest.Update) => {
|
||||
const { id: workflowId } = req.params;
|
||||
const { forceSave } = req.query;
|
||||
|
||||
const updateData = new WorkflowEntity();
|
||||
const { tags, ...rest } = req.body;
|
||||
@@ -356,22 +355,6 @@ workflowsController.patch(
|
||||
);
|
||||
}
|
||||
|
||||
const lastKnownDate = new Date(req.body.updatedAt).getTime();
|
||||
const storedDate = new Date(shared.workflow.updatedAt).getTime();
|
||||
|
||||
if (!forceSave && lastKnownDate !== storedDate) {
|
||||
LoggerProxy.info(
|
||||
'User was blocked from updating a workflow that was changed by another user',
|
||||
{ workflowId, userId: req.user.id },
|
||||
);
|
||||
|
||||
throw new ResponseHelper.ResponseError(
|
||||
`Workflow ID ${workflowId} cannot be saved because it was changed by another user.`,
|
||||
undefined,
|
||||
400,
|
||||
);
|
||||
}
|
||||
|
||||
// check credentials for old format
|
||||
await WorkflowHelpers.replaceInvalidCredentials(updateData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user