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 saving unsaved data in finish workflow action #10157 #10158

Merged
merged 4 commits into from
Oct 23, 2023

Conversation

jacobtylerwalls
Copy link
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

7cccf96 relied on a recursive call to self.finishWorkflow() to handle marking the workflow as complete, but besides the TypeError from using this instead of self, it was also executing a bunch of unnecessary requests instead of only sending one POST for the unsaved data and one POST for marking complete. Extracted a new function to mitigate that.

Issues Solved

Closes #10157

Copy link
Contributor

@chrabyrd chrabyrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good, just a few nits about stuff that was already there since we're refactoring.

Comment on lines 441 to 443
self.activeStep().save().then(function() {
self.markWorkflowComplete();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this can be reduced to self.activeStep().save().then(self.markWorkflowComplete)

Comment on lines 444 to 446
return;
}
self.markWorkflowComplete();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit ( since we're refactoring ): replacing the return statement with if/else logic is slightly more readable.

Copy link
Contributor

@chrabyrd chrabyrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@chrabyrd chrabyrd merged commit 0d310ad into dev/7.5.x Oct 23, 2023
1 check passed
@chrabyrd chrabyrd deleted the 10157-finish-workflow branch October 23, 2023 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[workflows] this.finishWorkflow is not a function
2 participants