Skip to content
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

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

Merged
merged 2 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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