Properly return empty token on empty poll request
@@ -331,6 +331,7 @@ func (wh *WorkflowHandler) PollForDecisionTask(
var history *gen.History
var persistenceToken []byte
+ var continuation []byte
if matchingResp.IsSetWorkflowExecution() {
// Non-empty response. Get the history
history, persistenceToken, err = wh.getHistory(
@@ -338,13 +339,13 @@ func (wh *WorkflowHandler) PollForDecisionTask(
if err != nil {
return nil, wrapError(err)
}
- }
- continuation, err :=
+ continuation, err =
getSerializedGetHistoryToken(persistenceToken, matchingResp.GetWorkflowExecution().GetRunId(), history, matchingResp.GetStartedEventId()+1)
if err != nil {
return nil, wrapError(err)
}
+ }
return createPollForDecisionTaskResponse(matchingResp, history, continuation), nil
}
