Skip to content

Commit c15ce45

Browse files
committed
Merged PR 49165: [release/9/0] Merge from public
#### AI description (iteration 1) #### PR Classification Version update. #### PR Summary This pull request updates the baseline package versions from 9.0.2 to 9.0.4. - Changes in `/eng/Baseline.xml`: Updated all package versions from 9.0.2 to 9.0.4. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2 parents 398176a + ff7932a commit c15ce45

File tree

11 files changed

+767
-532
lines changed

11 files changed

+767
-532
lines changed

eng/Baseline.Designer.props

Lines changed: 388 additions & 388 deletions
Large diffs are not rendered by default.

eng/Baseline.xml

Lines changed: 106 additions & 106 deletions
Large diffs are not rendered by default.

eng/Version.Details.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -388,39 +388,39 @@
388388
<Uri>https://github.com/dotnet/winforms</Uri>
389389
<Sha>9b822fd70005bf5632d12fe76811b97b3dd044e4</Sha>
390390
</Dependency>
391-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25208.4">
391+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25208.6">
392392
<Uri>https://github.com/dotnet/arcade</Uri>
393-
<Sha>ca3c62aa504aaefb17782282cc3ae7723562cf95</Sha>
393+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
394394
</Dependency>
395395
<!-- Intermediate is necessary for source build. -->
396-
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25208.4">
396+
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25208.6">
397397
<Uri>https://github.com/dotnet/arcade</Uri>
398-
<Sha>ca3c62aa504aaefb17782282cc3ae7723562cf95</Sha>
398+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
399399
<SourceBuild RepoName="arcade" ManagedOnly="true" />
400400
</Dependency>
401-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="9.0.0-beta.25208.4">
401+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="9.0.0-beta.25208.6">
402402
<Uri>https://github.com/dotnet/arcade</Uri>
403-
<Sha>ca3c62aa504aaefb17782282cc3ae7723562cf95</Sha>
403+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
404404
</Dependency>
405-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.25208.4">
405+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.25208.6">
406406
<Uri>https://github.com/dotnet/arcade</Uri>
407-
<Sha>ca3c62aa504aaefb17782282cc3ae7723562cf95</Sha>
407+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
408408
</Dependency>
409-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25208.4">
409+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25208.6">
410410
<Uri>https://github.com/dotnet/arcade</Uri>
411-
<Sha>ca3c62aa504aaefb17782282cc3ae7723562cf95</Sha>
411+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
412412
</Dependency>
413-
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.25208.4">
413+
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.25208.6">
414414
<Uri>https://github.com/dotnet/arcade</Uri>
415-
<Sha>ca3c62aa504aaefb17782282cc3ae7723562cf95</Sha>
415+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
416416
</Dependency>
417-
<Dependency Name="Microsoft.Extensions.Diagnostics.Testing" Version="9.4.0-preview.1.25178.3">
417+
<Dependency Name="Microsoft.Extensions.Diagnostics.Testing" Version="9.5.0-preview.1.25204.8">
418418
<Uri>https://github.com/dotnet/extensions</Uri>
419-
<Sha>56df0c4f4933909367536413dcf9c16520a37f82</Sha>
419+
<Sha>2fbf99834c90a20b950b44b3dcdd2b264b422a59</Sha>
420420
</Dependency>
421-
<Dependency Name="Microsoft.Extensions.TimeProvider.Testing" Version="9.4.0-preview.1.25178.3">
421+
<Dependency Name="Microsoft.Extensions.TimeProvider.Testing" Version="9.5.0-preview.1.25204.8">
422422
<Uri>https://github.com/dotnet/extensions</Uri>
423-
<Sha>56df0c4f4933909367536413dcf9c16520a37f82</Sha>
423+
<Sha>2fbf99834c90a20b950b44b3dcdd2b264b422a59</Sha>
424424
</Dependency>
425425
<Dependency Name="NuGet.Frameworks" Version="6.2.4">
426426
<Uri>https://github.com/nuget/nuget.client</Uri>

eng/Versions.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AspNetCorePatchVersion>5</AspNetCorePatchVersion>
1212
<PreReleaseVersionIteration>
1313
</PreReleaseVersionIteration>
14-
<ValidateBaseline>false</ValidateBaseline>
14+
<ValidateBaseline>true</ValidateBaseline>
1515
<IdentityModelVersion Condition="'$(IsIdentityModelTestJob)' != 'true'">8.0.1</IdentityModelVersion>
1616
<IdentityModelVersion Condition="'$(IsIdentityModelTestJob)' == 'true'">*-*</IdentityModelVersion>
1717
<!--
@@ -143,8 +143,8 @@
143143
<SystemIOHashingVersion>9.0.4</SystemIOHashingVersion>
144144
<SystemRuntimeCachingVersion>9.0.4</SystemRuntimeCachingVersion>
145145
<!-- Packages from dotnet/extensions -->
146-
<MicrosoftExtensionsDiagnosticsTestingVersion>9.4.0-preview.1.25178.3</MicrosoftExtensionsDiagnosticsTestingVersion>
147-
<MicrosoftExtensionsTimeProviderTestingVersion>9.4.0-preview.1.25178.3</MicrosoftExtensionsTimeProviderTestingVersion>
146+
<MicrosoftExtensionsDiagnosticsTestingVersion>9.5.0-preview.1.25204.8</MicrosoftExtensionsDiagnosticsTestingVersion>
147+
<MicrosoftExtensionsTimeProviderTestingVersion>9.5.0-preview.1.25204.8</MicrosoftExtensionsTimeProviderTestingVersion>
148148
<!-- Packages from dotnet/efcore -->
149149
<dotnetefVersion>9.0.4</dotnetefVersion>
150150
<MicrosoftEntityFrameworkCoreInMemoryVersion>9.0.4</MicrosoftEntityFrameworkCoreInMemoryVersion>
@@ -166,10 +166,10 @@
166166
<NuGetVersioningVersion>6.2.4</NuGetVersioningVersion>
167167
<NuGetFrameworksVersion>6.2.4</NuGetFrameworksVersion>
168168
<!-- Packages from dotnet/arcade -->
169-
<MicrosoftDotNetBuildTasksInstallersVersion>9.0.0-beta.25208.4</MicrosoftDotNetBuildTasksInstallersVersion>
170-
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25208.4</MicrosoftDotNetBuildTasksTemplatingVersion>
171-
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.25208.4</MicrosoftDotNetRemoteExecutorVersion>
172-
<MicrosoftSourceBuildIntermediatearcadeVersion>9.0.0-beta.25208.4</MicrosoftSourceBuildIntermediatearcadeVersion>
169+
<MicrosoftDotNetBuildTasksInstallersVersion>9.0.0-beta.25208.6</MicrosoftDotNetBuildTasksInstallersVersion>
170+
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25208.6</MicrosoftDotNetBuildTasksTemplatingVersion>
171+
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.25208.6</MicrosoftDotNetRemoteExecutorVersion>
172+
<MicrosoftSourceBuildIntermediatearcadeVersion>9.0.0-beta.25208.6</MicrosoftSourceBuildIntermediatearcadeVersion>
173173
<!-- Packages from dotnet/source-build-externals -->
174174
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>9.0.0-alpha.1.24575.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
175175
<!-- Packages from dotnet/source-build-reference-packages -->

global.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "9.0.104"
3+
"version": "9.0.105"
44
},
55
"tools": {
6-
"dotnet": "9.0.104",
6+
"dotnet": "9.0.105",
77
"runtimes": {
88
"dotnet/x86": [
99
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
@@ -27,7 +27,7 @@
2727
"jdk": "latest"
2828
},
2929
"msbuild-sdks": {
30-
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25208.4",
31-
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25208.4"
30+
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25208.6",
31+
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25208.6"
3232
}
3333
}

src/SignalR/common/Shared/MessageBuffer.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,16 @@ private async Task RunTimer()
121121

122122
public ValueTask<FlushResult> WriteAsync(SerializedHubMessage hubMessage, CancellationToken cancellationToken)
123123
{
124-
return WriteAsyncCore(hubMessage.Message!, hubMessage.GetSerializedMessage(_protocol), cancellationToken);
124+
// Default to HubInvocationMessage as that's the only type we use SerializedHubMessage for currently when Message is null. Should harden this in the future.
125+
return WriteAsyncCore(hubMessage.Message?.GetType() ?? typeof(HubInvocationMessage), hubMessage.GetSerializedMessage(_protocol), cancellationToken);
125126
}
126127

127128
public ValueTask<FlushResult> WriteAsync(HubMessage hubMessage, CancellationToken cancellationToken)
128129
{
129-
return WriteAsyncCore(hubMessage, _protocol.GetMessageBytes(hubMessage), cancellationToken);
130+
return WriteAsyncCore(hubMessage.GetType(), _protocol.GetMessageBytes(hubMessage), cancellationToken);
130131
}
131132

132-
private async ValueTask<FlushResult> WriteAsyncCore(HubMessage hubMessage, ReadOnlyMemory<byte> messageBytes, CancellationToken cancellationToken)
133+
private async ValueTask<FlushResult> WriteAsyncCore(Type hubMessageType, ReadOnlyMemory<byte> messageBytes, CancellationToken cancellationToken)
133134
{
134135
// TODO: Add backpressure based on message count
135136
if (_bufferedByteCount > _bufferLimit)
@@ -158,7 +159,7 @@ private async ValueTask<FlushResult> WriteAsyncCore(HubMessage hubMessage, ReadO
158159
await _writeLock.WaitAsync(cancellationToken: default).ConfigureAwait(false);
159160
try
160161
{
161-
if (hubMessage is HubInvocationMessage invocationMessage)
162+
if (typeof(HubInvocationMessage).IsAssignableFrom(hubMessageType))
162163
{
163164
_totalMessageCount++;
164165
_bufferedByteCount += messageBytes.Length;

src/SignalR/server/Core/src/SerializedHubMessage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Diagnostics;
45
using Microsoft.AspNetCore.SignalR.Protocol;
56

67
namespace Microsoft.AspNetCore.SignalR;
@@ -40,6 +41,8 @@ public SerializedHubMessage(IReadOnlyList<SerializedMessage> messages)
4041
/// <param name="message">The hub message for the cache. This will be serialized with an <see cref="IHubProtocol"/> in <see cref="GetSerializedMessage"/> to get the message's serialized representation.</param>
4142
public SerializedHubMessage(HubMessage message)
4243
{
44+
// Type currently only used for invocation messages, we should probably refactor it to be explicit about that e.g. new property for message type?
45+
Debug.Assert(message.GetType().IsAssignableTo(typeof(HubInvocationMessage)));
4346
Message = message;
4447
}
4548

src/SignalR/server/SignalR/test/Microsoft.AspNetCore.SignalR.Tests/Internal/MessageBufferTests.cs

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.IO.Pipelines;
5+
using System.Text.Json;
56
using Microsoft.AspNetCore.Connections;
67
using Microsoft.AspNetCore.Http.Features;
8+
using Microsoft.AspNetCore.InternalTesting;
79
using Microsoft.AspNetCore.SignalR.Internal;
810
using Microsoft.AspNetCore.SignalR.Protocol;
9-
using Microsoft.AspNetCore.InternalTesting;
1011
using Microsoft.Extensions.Logging.Abstractions;
1112
using Microsoft.Extensions.Time.Testing;
1213

@@ -169,6 +170,62 @@ public async Task UnAckedMessageResentOnReconnect()
169170
Assert.False(messageBuffer.ShouldProcessMessage(CompletionMessage.WithResult("1", null)));
170171
}
171172

173+
// Regression test for https://github.com/dotnet/aspnetcore/issues/55575
174+
[Fact]
175+
public async Task UnAckedSerializedMessageResentOnReconnect()
176+
{
177+
var protocol = new JsonHubProtocol();
178+
var connection = new TestConnectionContext();
179+
var pipes = DuplexPipe.CreateConnectionPair(new PipeOptions(), new PipeOptions());
180+
connection.Transport = pipes.Transport;
181+
using var messageBuffer = new MessageBuffer(connection, protocol, bufferLimit: 1000, NullLogger.Instance);
182+
183+
var invocationMessage = new SerializedHubMessage([new SerializedMessage(protocol.Name,
184+
protocol.GetMessageBytes(new InvocationMessage("method1", [1])))]);
185+
await messageBuffer.WriteAsync(invocationMessage, default);
186+
187+
var res = await pipes.Application.Input.ReadAsync();
188+
189+
var buffer = res.Buffer;
190+
Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
191+
var parsedMessage = Assert.IsType<InvocationMessage>(message);
192+
Assert.Equal("method1", parsedMessage.Target);
193+
Assert.Equal(1, ((JsonElement)Assert.Single(parsedMessage.Arguments)).GetInt32());
194+
195+
pipes.Application.Input.AdvanceTo(buffer.Start);
196+
197+
DuplexPipe.UpdateConnectionPair(ref pipes, connection);
198+
await messageBuffer.ResendAsync(pipes.Transport.Output);
199+
200+
Assert.True(messageBuffer.ShouldProcessMessage(PingMessage.Instance));
201+
Assert.True(messageBuffer.ShouldProcessMessage(CompletionMessage.WithResult("1", null)));
202+
Assert.True(messageBuffer.ShouldProcessMessage(new SequenceMessage(1)));
203+
204+
res = await pipes.Application.Input.ReadAsync();
205+
206+
buffer = res.Buffer;
207+
Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out message));
208+
var seqMessage = Assert.IsType<SequenceMessage>(message);
209+
Assert.Equal(1, seqMessage.SequenceId);
210+
211+
pipes.Application.Input.AdvanceTo(buffer.Start);
212+
213+
res = await pipes.Application.Input.ReadAsync();
214+
215+
buffer = res.Buffer;
216+
Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out message));
217+
parsedMessage = Assert.IsType<InvocationMessage>(message);
218+
Assert.Equal("method1", parsedMessage.Target);
219+
Assert.Equal(1, ((JsonElement)Assert.Single(parsedMessage.Arguments)).GetInt32());
220+
221+
pipes.Application.Input.AdvanceTo(buffer.Start);
222+
223+
messageBuffer.ShouldProcessMessage(new SequenceMessage(1));
224+
225+
Assert.True(messageBuffer.ShouldProcessMessage(PingMessage.Instance));
226+
Assert.False(messageBuffer.ShouldProcessMessage(CompletionMessage.WithResult("1", null)));
227+
}
228+
172229
[Fact]
173230
public async Task AckedMessageNotResentOnReconnect()
174231
{

0 commit comments

Comments
 (0)