Skip to content

Commit

Permalink
remove configure awaits (#4582)
Browse files Browse the repository at this point in the history
* fix OAuth with emulator and no credentials

* remove configureawait(False), as we need to keep the callers context for callbacks

* bump version to 3.15.2.2
  • Loading branch information
Tom Laird-McConnell committed May 8, 2018
1 parent cc73ce2 commit 6df7bbe
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

[assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Tests")]
[assembly: InternalsVisibleTo("Microsoft.Bot.Sample.Tests")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

[assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Tests")]
[assembly: InternalsVisibleTo("Microsoft.Bot.Sample.Tests")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]
14 changes: 7 additions & 7 deletions CSharp/Library/Microsoft.Bot.Builder/Dialogs/GetTokenDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ public GetTokenDialog(string connectionName, string signInMessage, string button
public async Task StartAsync(IDialogContext context)
{
// First ask Bot Service if it already has a token for this user
var token = await context.GetUserTokenAsync(_connectionName).ConfigureAwait(false);
var token = await context.GetUserTokenAsync(_connectionName);
if (token != null)
{
context.Done(new GetTokenResponse() { Token = token.Token });
}
else
{
// If Bot Service does not have a token, send an OAuth card to sign in
await SendOAuthCardAsync(context, (Activity)context.Activity).ConfigureAwait(false);
await SendOAuthCardAsync(context, (Activity)context.Activity);
}
}

private async Task SendOAuthCardAsync(IDialogContext context, Activity activity)
{
var reply = await activity.CreateOAuthReplyAsync(_connectionName, _signInMessage, _buttonLabel).ConfigureAwait(false);
await context.PostAsync(reply).ConfigureAwait(false);
var reply = await activity.CreateOAuthReplyAsync(_connectionName, _signInMessage, _buttonLabel);
await context.PostAsync(reply);
context.Wait(WaitForToken);
}

Expand Down Expand Up @@ -113,7 +113,7 @@ private async Task WaitForToken(IDialogContext context, IAwaitable<object> resul
verificationCode = activity.Text;
}

tokenResponse = await context.GetUserTokenAsync(_connectionName, verificationCode).ConfigureAwait(false);
tokenResponse = await context.GetUserTokenAsync(_connectionName, verificationCode);
if (tokenResponse != null)
{
context.Done(new GetTokenResponse() { Token = tokenResponse.Token });
Expand All @@ -124,8 +124,8 @@ private async Task WaitForToken(IDialogContext context, IAwaitable<object> resul
if (_reties > 0)
{
_reties--;
await context.PostAsync(_retryMessage).ConfigureAwait(false);
await SendOAuthCardAsync(context, activity).ConfigureAwait(false);
await context.PostAsync(_retryMessage);
await SendOAuthCardAsync(context, activity);
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions CSharp/Library/Microsoft.Bot.Builder/Dialogs/LuisDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ protected virtual async Task MessageReceived(IDialogContext context, IAwaitable<
var tasks = this.services.Select(async s =>
{
var request = ModifyLuisRequest(s.ModifyRequest(new LuisRequest(messageText)));
var result = await s.QueryAsync(request, context.CancellationToken).ConfigureAwait(false);
var result = await s.QueryAsync(request, context.CancellationToken);
return Tuple.Create(request, result);
}).ToArray();
Expand All @@ -243,7 +243,7 @@ protected virtual async Task MessageReceived(IDialogContext context, IAwaitable<
throw new InvalidOperationException("No winning intent selected from Luis results.");
}

await EmitTraceInfo(context, winner.Result, winner.LuisRequest, winner.LuisService.LuisModel).ConfigureAwait(false);
await EmitTraceInfo(context, winner.Result, winner.LuisRequest, winner.LuisService.LuisModel);

if (winner.Result.Dialog?.Status == DialogResponse.DialogStatus.Question)
{
Expand Down Expand Up @@ -329,7 +329,7 @@ private static async Task EmitTraceInfo(IBotContext context, LuisResult luisResu
LuisModel = RemoveSensitiveData(luisModel)
};
var activity = Activity.CreateTraceActivityReply(context.Activity as Activity, LuisTraceName, LuisTraceType, luisTraceInfo, LuisTraceLabel) as IMessageActivity;
await context.PostAsync(activity).ConfigureAwait(false);
await context.PostAsync(activity);
}

public static ILuisModel RemoveSensitiveData(ILuisModel luisModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency id="Autofac" version="3.5.2"/>
<dependency id="Chronic.Signed" version="0.3.2" />
<dependency id="Microsoft.AspNet.WebAPI.Core" version="5.2.3" />
<dependency id="Microsoft.Bot.Connector" version="3.15.2.1" />
<dependency id="Microsoft.Bot.Connector" version="3.15.2.2" />
<dependency id="Microsoft.Rest.ClientRuntime" version="2.3.2" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="System.IdentityModel.Tokens.Jwt" version="5.1.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]


[assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Tests")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Microsoft.Bot.Connector.AspNetCore</id>
<version>1.1.3.14</version>
<version>1.1.3.15</version>
<authors>Microsoft</authors>
<owners>microsoft, BotFramework, nugetbotbuilder </owners>
<iconUrl>https://bots.botframework.com/Client/Images/bot-framework-default-7.png</iconUrl>
Expand All @@ -22,7 +22,7 @@
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="System.IdentityModel.Tokens.Jwt" version="5.1.4" />
<dependency id="Microsoft.AspNetCore.Mvc.Core" version="1.1.4" />
<dependency id="Microsoft.Bot.Connector" version="3.15.2.1" />
<dependency id="Microsoft.Bot.Connector" version="3.15.2.2" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
[assembly: AssemblyCulture("")]


[assembly: AssemblyVersion("1.1.3.14")]
[assembly: AssemblyFileVersion("1.1.3.14")]
[assembly: AssemblyVersion("1.1.3.15")]
[assembly: AssemblyFileVersion("1.1.3.15")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
[assembly: AssemblyCulture("")]


[assembly: AssemblyVersion("2.0.1.6")]
[assembly: AssemblyFileVersion("2.0.1.6")]
[assembly: AssemblyVersion("2.0.1.7")]
[assembly: AssemblyFileVersion("2.0.1.7")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Microsoft.Bot.Connector.AspNetCore</id>
<version>2.0.1.6</version>
<version>2.0.1.7</version>
<authors>Microsoft</authors>
<owners>microsoft, BotFramework, nugetbotbuilder </owners>
<iconUrl>https://bots.botframework.com/Client/Images/bot-framework-default-7.png</iconUrl>
Expand All @@ -19,7 +19,7 @@
<dependency id="Microsoft.AspNetCore.Authentication.JwtBearer" version="2.0.0" />
<dependency id="Microsoft.AspNetCore.Mvc" version="2.0.0" />
<dependency id="Microsoft.Rest.ClientRuntime" version="2.3.10" />
<dependency id="Microsoft.Bot.Connector" version="3.15.2.1" />
<dependency id="Microsoft.Bot.Connector" version="3.15.2.2" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Microsoft.Bot.Connector</id>
<version>3.15.2.1</version>
<version>3.15.2.2</version>
<authors>Microsoft</authors>
<owners>microsoft, BotFramework, nugetbotbuilder </owners>
<iconUrl>https://bots.botframework.com/Client/Images/bot-framework-default-7.png</iconUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Reflection;
using System.Resources;

[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Microsoft.Bot.Connector</id>
<version>3.15.2.1</version>
<version>3.15.2.2</version>
<authors>Microsoft</authors>
<owners>microsoft, BotFramework, nugetbotbuilder </owners>
<iconUrl>https://bots.botframework.com/Client/Images/bot-framework-default-7.png</iconUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("3.15.2.1")]
[assembly: AssemblyFileVersion("3.15.2.1")]
[assembly: AssemblyVersion("3.15.2.2")]
[assembly: AssemblyFileVersion("3.15.2.2")]

//[assembly: AssemblyKeyFileAttribute(@"..\\..\\buildtools\\35MSSharedLib1024.snk")]
//[assembly: AssemblyDelaySignAttribute(true)]

0 comments on commit 6df7bbe

Please sign in to comment.