Skip to content

Commit

Permalink
Merge pull request #907 from Microsoft/johtaylo/warn-and-order
Browse files Browse the repository at this point in the history
warning message and order of state trace
  • Loading branch information
cleemullins authored May 1, 2019
2 parents f7e33f3 + c23a29f commit 69f89ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/botbuilder/src/inspectionMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ abstract class InterceptionMiddleware implements Middleware {
await this.invokeOutbound(ctx, [ traceActivity ]);
return await nextDelete();
});

await this.invokeTraceState(turnContext);
}

if (shouldForwardToApplication) {
Expand All @@ -116,6 +114,11 @@ abstract class InterceptionMiddleware implements Middleware {
throw err;
}
}

if (shouldIntercept) {

await this.invokeTraceState(turnContext);
}
}

protected abstract inbound(turnContext: TurnContext, traceActivity: Partial<Activity>): Promise<any>;
Expand Down Expand Up @@ -358,6 +361,7 @@ class InspectionSession {
try {
await this.connectorClient.conversations.sendToConversation(activity.conversation.id, activity as Activity);
} catch (err) {
console.warn(`Exception '${ err }' while attempting to call Emulator for inspection, check it is running, and you have correct credentials in the Emulator and the InspectionMiddleware.`);
return false;
}

Expand Down

0 comments on commit 69f89ec

Please sign in to comment.