128
// and the event ID we are looking for is smaller than current next event ID
129
if expectedNextEventID >= response.GetNextEventId() && response.GetWorkflowStatus() == enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING {
130
>
subscriberID, channel, err := eventNotifier.WatchHistoryEvent(workflowKey)
get_workflow_util.go
131
>
if err != nil {
132
return nil, err
133
}
134
>
defer func() { _ = eventNotifier.UnwatchHistoryEvent(workflowKey, subscriberID) }()
get_workflow_util.go
135
// check again in case the next event ID is updated
137
>
ctx,
138
>
shardContext,
139
>
workflowKey,
140
>
request.VersionHistoryItem.GetVersion(),
141
>
request.VersionHistoryItem.GetEventId(),
142
>
request.VersionedTransition,
143
>
workflowConsistencyChecker,
144
>
)
145
>
if err != nil {
146
return nil, err
147
}
148
>
currentVersionHistory, err = versionhistory.GetCurrentVersionHistory(response.GetVersionHistories())
get_workflow_util.go
149
>
if err != nil {
150
return nil, err
151
}
152
154
>
currentVersionedTransition := transitionhistory.LastVersionedTransition(transitionHistory)
155
>
if len(transitionHistory) != 0 && request.VersionedTransition != nil {
156
if transitionhistory.StalenessCheck(transitionHistory, request.VersionedTransition) != nil {
157
logger.Warn(fmt.Sprintf("Request versioned transition and transition history don't match prior to polling the mutable state. Request: %v, current: %v",