Skip to content

Commit

Permalink
fix(editor): fix workflow not stopping on clicking stop button (#4382)
Browse files Browse the repository at this point in the history
* fix(editor): fix workflow not stopping

* address comment, fix for unsaved workflows
  • Loading branch information
mutdmour committed Oct 19, 2022
1 parent 263794c commit 50c18a7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/mixins/pushConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/mixins/restApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 50c18a7

Please sign in to comment.