refactor(core): Enable interim updates check (#4582)

*  Enable interim updates check

*  Set default value

*  Undo default value, keep as sentinel

* 🧪 Unskip tests
This commit is contained in:
Iván Ovejero 2022-11-14 15:38:19 +01:00 committed by GitHub
parent 0148631d28
commit e7316c588f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -196,13 +196,13 @@ export class WorkflowsService {
);
}
// if (!forceSave && workflow.hash !== shared.workflow.hash) {
// throw new ResponseHelper.ResponseError(
// `Workflow ID ${workflowId} cannot be saved because it was changed by another user.`,
// undefined,
// 400,
// );
// }
if (!forceSave && workflow.hash !== '' && workflow.hash !== shared.workflow.hash) {
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(workflow);

View file

@ -730,7 +730,7 @@ describe('PATCH /workflows/:id - validate credential permissions to user', () =>
});
});
describe.skip('PATCH /workflows/:id - validate interim updates', () => {
describe('PATCH /workflows/:id - validate interim updates', () => {
it('should block owner updating workflow nodes on interim update by member', async () => {
const owner = await testDb.createUser({ globalRole: globalOwnerRole });
const member = await testDb.createUser({ globalRole: globalMemberRole });