Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update several dependencies #624

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.8.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.312" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 7 additions & 3 deletions src/StreamJsonRpc/ActivityTracingStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ public void ApplyOutboundActivity(JsonRpcRequest request)
{
Requires.NotNull(request, nameof(request));

var state = new State(new Activity(request.Method));
var state = new State(new Activity(request.Method!));
state.NewActivity.TraceStateString = request.TraceState;
state.NewActivity.SetParentId(request.TraceParent);
if (request.TraceParent is object)
{
state.NewActivity.SetParentId(request.TraceParent);
}

state.NewActivity.Start();
return state;
}
Expand All @@ -46,7 +50,7 @@ internal State(Activity newActivity)
this.NewActivity = newActivity;
}

internal Activity PriorActivity { get; }
internal Activity? PriorActivity { get; }

internal Activity NewActivity { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/StreamJsonRpc/PipeMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public PipeMessageHandler(Stream? writer, Stream? reader, IJsonRpcMessageFormatt
{
Assumes.NotNull(this.Writer);
#pragma warning disable CS0618 // Type or member is obsolete (Nerdbank.Streams implements this, so it won't go away).
this.Writer.OnReaderCompleted((ex, state) => ((Stream)state).Dispose(), writer);
this.Writer.OnReaderCompleted((ex, state) => ((Stream)state!).Dispose(), writer);
#pragma warning restore CS0618 // Type or member is obsolete
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public MessageFormatterDuplexPipeTracker(JsonRpc jsonRpc, IJsonRpcFormatterState

// Track open channels to assist in diagnosing abandoned channels.
ImmutableInterlocked.TryAdd(ref this.openOutboundChannels, channel.QualifiedId, channel);
channel.Completion.ContinueWith(_ => ImmutableInterlocked.TryRemove(ref this.openOutboundChannels, channel.QualifiedId, out MultiplexingStream.Channel removedChannel), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default).Forget();
channel.Completion.ContinueWith(_ => ImmutableInterlocked.TryRemove(ref this.openOutboundChannels, channel.QualifiedId, out MultiplexingStream.Channel? removedChannel), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default).Forget();

return channel.QualifiedId.Id;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ public MessageFormatterDuplexPipeTracker(JsonRpc jsonRpc, IJsonRpcFormatterState

// In the case of multiple overloads, we might be called to convert a channel's token more than once.
// But we can only accept the channel once, so look up in a dictionary to see if we've already done this.
if (!this.openInboundChannels.TryGetValue(new MultiplexingStream.QualifiedChannelId(token.Value, MultiplexingStream.ChannelSource.Remote), out MultiplexingStream.Channel channel))
if (!this.openInboundChannels.TryGetValue(new MultiplexingStream.QualifiedChannelId(token.Value, MultiplexingStream.ChannelSource.Remote), out MultiplexingStream.Channel? channel))
{
channel = mxstream.AcceptChannel(token.Value);
if (!this.RequestIdBeingDeserialized.IsEmpty)
Expand All @@ -213,7 +213,7 @@ public MessageFormatterDuplexPipeTracker(JsonRpc jsonRpc, IJsonRpcFormatterState

// Track open channels to assist in diagnosing abandoned channels and handling multiple overloads.
ImmutableInterlocked.TryAdd(ref this.openInboundChannels, channel.QualifiedId, channel);
channel.Completion.ContinueWith(_ => ImmutableInterlocked.TryRemove(ref this.openInboundChannels, channel.QualifiedId, out MultiplexingStream.Channel removedChannel), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default).Forget();
channel.Completion.ContinueWith(_ => ImmutableInterlocked.TryRemove(ref this.openInboundChannels, channel.QualifiedId, out MultiplexingStream.Channel? removedChannel), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default).Forget();
}

return channel;
Expand Down Expand Up @@ -308,7 +308,7 @@ private void CleanUpInboundResources(RequestId requestId, bool successful)
return;
}

if (ImmutableInterlocked.TryRemove(ref this.inboundRequestChannelMap, requestId, out ImmutableList<MultiplexingStream.Channel> channels))
if (ImmutableInterlocked.TryRemove(ref this.inboundRequestChannelMap, requestId, out ImmutableList<MultiplexingStream.Channel>? channels))
{
// Only kill the channels if the server threw an error.
// Successful responses make it the responsibility of the client/server to terminate the pipe.
Expand All @@ -329,7 +329,7 @@ private void CleanUpOutboundResources(RequestId requestId, bool successful)
return;
}

if (ImmutableInterlocked.TryRemove(ref this.outboundRequestChannelMap, requestId, out ImmutableList<MultiplexingStream.Channel> channels))
if (ImmutableInterlocked.TryRemove(ref this.outboundRequestChannelMap, requestId, out ImmutableList<MultiplexingStream.Channel>? channels))
{
// Only kill the channels if the server threw an error.
// Successful responses make it the responsibility of the client/server to terminate the pipe.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private void ReleaseMarshaledObject(long handle, bool ownedBySender)

private void CleanUpOutboundResources(RequestId requestId, bool successful)
{
if (ImmutableInterlocked.TryRemove(ref this.outboundRequestIdMarshalMap, requestId, out ImmutableList<long> handles))
if (ImmutableInterlocked.TryRemove(ref this.outboundRequestIdMarshalMap, requestId, out ImmutableList<long>? handles))
{
// Only kill the marshaled objects if the server threw an error.
// Successful responses make it the responsibility of the client/server to terminate the marshaled connection.
Expand Down
18 changes: 8 additions & 10 deletions src/StreamJsonRpc/StreamJsonRpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MessagePack" Version="2.2.60" />
<PackageReference Include="MessagePackAnalyzer" Version="2.2.60" PrivateAssets="all" />
<!-- <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4" PrivateAssets="all" /> -->
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.8.55" PrivateAssets="all" />
<PackageReference Include="MessagePack" Version="2.2.85" />
<PackageReference Include="MessagePackAnalyzer" Version="2.2.85" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="16.8.55" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" PrivateAssets="compile" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" PrivateAssets="compile" />
<PackageReference Include="Nerdbank.Streams" Version="2.6.81" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.2" PrivateAssets="all" />
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.7.1" />
<PackageReference Include="System.IO.Pipelines" Version="4.7.3" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
<PackageReference Include="System.IO.Pipelines" Version="5.0.1" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Net.WebSockets" Version="4.3.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.11.1" PrivateAssets="compile" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" PrivateAssets="compile" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="XliffTasks" Version="1.0.0-beta.19253.2" PrivateAssets="all" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions test/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" version="0.12.1" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/StreamJsonRpc.Tests/ActivityTracingStrategyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void Inbound_WithoutTraceParent(bool contextualActivity)
{
using (IDisposable? state = this.strategy.ApplyInboundActivity(this.request))
{
Assert.Same(testActivity, Activity.Current.Parent);
Assert.Same(testActivity, Activity.Current?.Parent);
}

Assert.Same(testActivity, Activity.Current);
Expand Down
6 changes: 3 additions & 3 deletions test/StreamJsonRpc.Tests/StreamJsonRpc.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
<PackageReference Include="coverlet.msbuild" Version="2.9.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.8.55" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Validation" Version="16.8.33" />
<PackageReference Include="System.IO.Pipes" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.11.1" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="xunit.combinatorial" Version="1.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
Expand Down