Skip to content

Commit

Permalink
Update CS testSkillHandler to update activity
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorGrycuk committed Jul 21, 2020
1 parent 0890605 commit 3471b17
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -232,6 +232,9 @@ private async Task<ResourceResponse> ProcessActivityAsync(ClaimsIdentity claimsI
throw new KeyNotFoundException();
}

// If an activity is sent, return the ResourceResponse
ResourceResponse resourceResponse = null;

var callback = new BotCallbackHandler(async (turnContext, ct) =>
{
turnContext.TurnState.Add(SkillConversationReferenceKey, skillConversationReference);
Expand All @@ -250,13 +253,17 @@ private async Task<ResourceResponse> ProcessActivityAsync(ClaimsIdentity claimsI
await _bot.OnTurnAsync(turnContext, ct).ConfigureAwait(false);
break;
default:
await turnContext.SendActivityAsync(activity, cancellationToken).ConfigureAwait(false);
resourceResponse = await turnContext.SendActivityAsync(activity, cancellationToken).ConfigureAwait(false);
break;
}
});

await _adapter.ContinueConversationAsync(claimsIdentity, skillConversationReference.ConversationReference, skillConversationReference.OAuthScope, callback, cancellationToken).ConfigureAwait(false);
return new ResourceResponse(Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture));
if (resourceResponse == null)
{
resourceResponse = new ResourceResponse() { Id = Guid.NewGuid().ToString() };
}
return resourceResponse;
}
}
}

0 comments on commit 3471b17

Please sign in to comment.