Skip to content

Commit

Permalink
fix: pulled across a load of fixes from Statebox!
Browse files Browse the repository at this point in the history
affects: statebox, tymly
  • Loading branch information
jezhiggins authored and exactlyaron committed Jun 13, 2018
1 parent 228d56e commit 8551eb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/plugin/components/services/statebox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class StateboxService {
.catch(err => callback(err))
}

const executionDescription = await this.statebox.describeExecution(executionName, executionOptions)
const executionDescription = await this.statebox.describeExecution(executionName)
const [authOk, errExecDesc] = await this.authorisationCheck(
executionOptions.userId,
executionDescription.stateMachineName,
Expand All @@ -113,12 +113,12 @@ class StateboxService {
}

describeExecution (executionName, executionOptions, callback) {
return this.statebox.describeExecution(executionName, executionOptions, callback)
}
return promiseOrCallback(this.statebox.describeExecution(executionName), callback)
} // describeExecution

async sendTaskSuccess (executionName, output, executionOptions, callback) {
if (callback) {
return promiseOrCallback(this.statebox.sendTaskSuccess(executionName, output, executionOptions), callback)
return promiseOrCallback(this.sendTaskSuccess(executionName, output, executionOptions), callback)
}

const executionDescription = await this.statebox.describeExecution(executionName, executionOptions)
Expand All @@ -131,7 +131,7 @@ class StateboxService {

// hmm, should we be returning the execution description here?
if (authOk) {
this.statebox.sendTaskSuccess(executionName, output, executionOptions)
return this.statebox.sendTaskSuccess(executionName, output)
} else {
throw new Error(errExecDesc.errorMessage)
}
Expand All @@ -142,7 +142,7 @@ class StateboxService {
}

sendTaskFailure (executionName, output, executionOptions, callback) {
this.statebox.sendTaskFailure(executionName, output, executionOptions, callback)
return promiseOrCallback(this.statebox.sendTaskFailure(executionName, output), callback)
}

waitUntilStoppedRunning (executionName, callback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class RunStateMachine {
} // class RunStateMachine

function desiredResponse (context) {
const callback = context.task.options.callbackManager.callbacks[context.executionName]
const callback = context.task.callbackManager.callbacks[context.executionName]
return callback ? callback.eventName : COMPLETE
} // desiredResponse

Expand Down

0 comments on commit 8551eb6

Please sign in to comment.