}
err = encoder.Decode(encodedRecord, &historyBlob)
if err != nil {
return nil, serviceerror.NewInternal(err.Error())
}
response.HistoryBatches = append(response.HistoryBatches, batch)
numOfEvents += len(batch.Events)
}
break
}
token.BatchIdx++
}
nextToken, err := SerializeToken(token)
if err != nil {