Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Conversation

cbraynor
Copy link
Contributor

Allowing a task to pass a _new_state in the object passed to resolve that overrides the task spec's finished_state

newTask._progress = 100;
newTask._error_details = null;
return newTask;
if (outputTask._new_state === false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's put a comment here explaining what exactly this does.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also let's move this conditional up with the self.finishedState null check.

outputTask._state = _.get(outputTask, '_new_state');
delete outputTask._new_state;
if (!_.isNull(outputTask._state) && !_.isString(outputTask._state)) {
if (_.isNull(self.finishedState) || outputTask._state === false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment about the explicit false API just because it's not necessarily intuitive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@mbleigh
Copy link
Contributor

mbleigh commented Mar 23, 2016

LGTM.

Let the Shipping Begin

@mbleigh mbleigh merged commit 7369ffe into master Mar 23, 2016
@mbleigh mbleigh deleted the cr-new-state branch March 23, 2016 21:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants