fix(editor): fix workflow not stopping on clicking stop button (#4382)

* fix(editor): fix workflow not stopping

* address comment, fix for unsaved workflows
This commit is contained in:
Mutasem Aldmour 2022-10-19 15:20:33 +02:00 committed by GitHub
parent 263794ce40
commit 50c18a789a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View file

@ -180,7 +180,7 @@ export interface IRestApi {
getWorkflow(id: string): Promise<IWorkflowDb>;
getWorkflows(filter?: object): Promise<IWorkflowShortResponse[]>;
getWorkflowFromUrl(url: string): Promise<IWorkflowDb>;
getExecution(id: string): Promise<IExecutionResponse>;
getExecution(id: string): Promise<IExecutionResponse | undefined>;
deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void>;
retryExecution(id: string, loadWorkflow?: boolean): Promise<boolean>;
getTimezones(): Promise<IDataObject>;

View file

@ -260,7 +260,7 @@ export const pushConnection = mixins(
this.$titleSet(workflow.name as string, 'ERROR');
if (
runDataExecuted.data.resultData.error!.name === 'ExpressionError' &&
runDataExecuted.data.resultData.error?.name === 'ExpressionError' &&
(runDataExecuted.data.resultData.error as ExpressionError).context.functionality === 'pairedItem'
) {
const error = runDataExecuted.data.resultData.error as ExpressionError;

View file

@ -129,9 +129,9 @@ export const restApi = Vue.extend({
},
// Returns the execution with the given name
getExecution: async (id: string): Promise<IExecutionResponse> => {
getExecution: async (id: string): Promise<IExecutionResponse | undefined> => {
const response = await self.restApi().makeRestApiRequest('GET', `/executions/${id}`);
return unflattenExecutionData(response);
return response && unflattenExecutionData(response);
},
// Deletes executions

View file

@ -1231,7 +1231,7 @@ export default mixins(
} catch (error) {
// Execution stop might fail when the execution has already finished. Let's treat this here.
const execution = await this.restApi().getExecution(executionId);
if (execution.finished) {
if (execution?.finished) {
const executedData = {
data: execution.data,
finished: execution.finished,