Skip to content

Commit 6bfabbf

Browse files
authored
Update messagepack to tag v2.5.192 (#2089)
* Update messagepack to tag v2.1.115 * Adding pitfalls * Make protocol projects nullable * Throw with parameter name * Fix nullable * update ...+ console.log("Application has started successfully."); ``` file: src/config.js diff: ``` - const port = 3000; + const port = process.env.PORT || 3000; ``` Commit message: Update log message and port configuration * Fix build failure
1 parent 3f2a64a commit 6bfabbf

File tree

12 files changed

+128
-85
lines changed

12 files changed

+128
-85
lines changed

build/dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<MicrosoftAspNetCoreSignalRPackageVersion>1.0.0</MicrosoftAspNetCoreSignalRPackageVersion>
1414
<MicrosoftAspNetCoreLocalizationPackageVersion>2.1.0</MicrosoftAspNetCoreLocalizationPackageVersion>
1515
<SystemBuffersPackageVersion>4.5.1</SystemBuffersPackageVersion>
16-
<SystemMemoryPackageVersion>4.5.4</SystemMemoryPackageVersion>
16+
<SystemMemoryPackageVersion>4.5.5</SystemMemoryPackageVersion>
1717
<SystemRuntimeCompilerServicesUnsafePackageVersion>6.0.0</SystemRuntimeCompilerServicesUnsafePackageVersion>
1818
<AzureIdentityPackageVersion>1.11.4</AzureIdentityPackageVersion>
1919
<MicrosoftExtensionsLoggingPackageVersion>2.1.0</MicrosoftExtensionsLoggingPackageVersion>

src/Microsoft.Azure.SignalR.Management/WebsocketsHubLifetimeManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3-
3+
#nullable enable
44
using System;
55
using System.Threading;
66
using System.Threading.Tasks;

src/Microsoft.Azure.SignalR.Protocols/ConnectionMessage.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public OpenConnectionMessage(string connectionId, Claim[]? claims)
5454
/// <param name="claims">An array of <see cref="Claim"/> associated with the connection.</param>
5555
/// <param name="headers">A <see cref="IDictionary{TKey,TValue}"/> associated with the connection.</param>
5656
/// <param name="queryString">Query string associated with the connection.</param>
57-
public OpenConnectionMessage(string connectionId, Claim[]? claims, IDictionary<string, StringValues> headers, string queryString)
57+
public OpenConnectionMessage(string connectionId, Claim[]? claims, IDictionary<string, StringValues> headers, string? queryString)
5858
: base(connectionId)
5959
{
6060
Claims = claims ?? [];
@@ -75,7 +75,7 @@ public OpenConnectionMessage(string connectionId, Claim[]? claims, IDictionary<s
7575
/// <summary>
7676
/// Gets or sets the associated query string.
7777
/// </summary>
78-
public string QueryString { get; set; }
78+
public string? QueryString { get; set; }
7979

8080
/// <summary>
8181
/// Gets or sets the protocol for new connection.
@@ -99,7 +99,7 @@ public class CloseConnectionMessage : ConnectionMessage, IMessageWithTracingId
9999
/// <param name="connectionId">The connection Id.</param>
100100
/// <param name="errorMessage">Optional error message.</param>
101101
/// <param name="headers">A <see cref="IDictionary{TKey,TValue}"/> associated with the connection.</param>
102-
public CloseConnectionMessage(string connectionId, string errorMessage, IDictionary<string, StringValues>? headers = null) : base(connectionId)
102+
public CloseConnectionMessage(string connectionId, string? errorMessage, IDictionary<string, StringValues>? headers = null) : base(connectionId)
103103
{
104104
ErrorMessage = errorMessage ?? "";
105105
Headers = headers ?? new Dictionary<string, StringValues>();
@@ -230,7 +230,7 @@ public class ClientCompletionMessage : ServiceCompletionMessage, IHasProtocol
230230
/// <param name="protocol">The protocol of the connection.</param>
231231
/// <param name="payload">The payload of the completion result.</param>
232232
/// <param name="tracingId">The tracing Id of the message.</param>
233-
public ClientCompletionMessage(string invocationId, string connectionId, string callerServerId, string protocol, ReadOnlyMemory<byte> payload, ulong? tracingId = null)
233+
public ClientCompletionMessage(string invocationId, string connectionId, string callerServerId, string? protocol, ReadOnlyMemory<byte> payload, ulong? tracingId = null)
234234
: base(invocationId, connectionId, callerServerId, tracingId)
235235
{
236236
Protocol = protocol;
@@ -261,10 +261,10 @@ public class ErrorCompletionMessage : ServiceCompletionMessage
261261
/// <param name="callerServerId">The serverId that wrap the completion result.</param>
262262
/// <param name="error">The error information about invacation failure.</param>
263263
/// <param name="tracingId">The tracing Id of the message.</param>
264-
public ErrorCompletionMessage(string invocationId, string connectionId, string callerServerId, string error, ulong? tracingId = null)
264+
public ErrorCompletionMessage(string invocationId, string connectionId, string callerServerId, string? error, ulong? tracingId = null)
265265
: base(invocationId, connectionId, callerServerId, tracingId)
266266
{
267-
Error = error;
267+
Error = error ?? string.Empty;
268268
}
269269

270270
/// <summary>

src/Microsoft.Azure.SignalR.Protocols/GroupMessage.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class LeaveGroupMessage : ExtensibleServiceMessage, IMessageWithTracingId
5353
/// <summary>
5454
/// Gets or sets the group name.
5555
/// </summary>
56-
public string GroupName { get; set; }
56+
public string? GroupName { get; set; }
5757

5858
/// <summary>
5959
/// Gets or sets the tracing Id
@@ -68,7 +68,7 @@ public class LeaveGroupMessage : ExtensibleServiceMessage, IMessageWithTracingId
6868
/// <param name="connectionId">The connection Id.</param>
6969
/// <param name="groupName">The group name, from which the connection will leave.</param>
7070
/// <param name="tracingId">The tracing Id of the message.</param>
71-
public LeaveGroupMessage(string connectionId, string groupName, ulong? tracingId = null)
71+
public LeaveGroupMessage(string connectionId, string? groupName, ulong? tracingId = null)
7272
{
7373
ConnectionId = connectionId;
7474
GroupName = groupName;
@@ -130,7 +130,7 @@ public class UserLeaveGroupMessage : ExtensibleServiceMessage, IMessageWithTraci
130130
/// <summary>
131131
/// Gets or sets the group name.
132132
/// </summary>
133-
public string GroupName { get; set; }
133+
public string? GroupName { get; set; }
134134

135135
/// <summary>
136136
/// Gets or sets the tracing Id
@@ -145,7 +145,7 @@ public class UserLeaveGroupMessage : ExtensibleServiceMessage, IMessageWithTraci
145145
/// <param name="userId">The user Id.</param>
146146
/// <param name="groupName">The group name, from which the user will leave.</param>
147147
/// <param name="tracingId">The tracing Id of the message.</param>
148-
public UserLeaveGroupMessage(string userId, string groupName, ulong? tracingId = null)
148+
public UserLeaveGroupMessage(string userId, string? groupName, ulong? tracingId = null)
149149
{
150150
UserId = userId;
151151
GroupName = groupName;
@@ -216,7 +216,7 @@ public class UserLeaveGroupWithAckMessage : ExtensibleServiceMessage, IMessageWi
216216
/// <summary>
217217
/// Gets or sets the group name.
218218
/// </summary>
219-
public string GroupName { get; set; }
219+
public string? GroupName { get; set; }
220220

221221
/// <summary>
222222
/// Gets or sets the tracing Id
@@ -237,7 +237,7 @@ public class UserLeaveGroupWithAckMessage : ExtensibleServiceMessage, IMessageWi
237237
/// <param name="groupName">The group name, from which the user will leave.</param>
238238
/// <param name="ackId">The ack Id.</param>
239239
/// <param name="tracingId">The tracing Id of the message.</param>
240-
public UserLeaveGroupWithAckMessage(string userId, string groupName, int ackId, ulong? tracingId = null)
240+
public UserLeaveGroupWithAckMessage(string userId, string? groupName, int ackId, ulong? tracingId = null)
241241
{
242242
UserId = userId;
243243
GroupName = groupName;
@@ -312,7 +312,7 @@ public class LeaveGroupWithAckMessage : ExtensibleServiceMessage, IAckableMessag
312312
/// <summary>
313313
/// Gets or sets the group name.
314314
/// </summary>
315-
public string GroupName { get; set; }
315+
public string? GroupName { get; set; }
316316

317317
/// <summary>
318318
/// Gets or sets the ack id.
@@ -332,7 +332,7 @@ public class LeaveGroupWithAckMessage : ExtensibleServiceMessage, IAckableMessag
332332
/// <param name="connectionId">The connection Id.</param>
333333
/// <param name="groupName">The group name, from which the connection will leave.</param>
334334
/// <param name="tracingId">The tracing Id of the message.</param>
335-
public LeaveGroupWithAckMessage(string connectionId, string groupName, ulong? tracingId = null): this(connectionId, groupName, 0, tracingId)
335+
public LeaveGroupWithAckMessage(string connectionId, string? groupName, ulong? tracingId = null): this(connectionId, groupName, 0, tracingId)
336336
{
337337
}
338338

@@ -343,7 +343,7 @@ public LeaveGroupWithAckMessage(string connectionId, string groupName, ulong? tr
343343
/// <param name="groupName">The group name, from which the connection will leave.</param>
344344
/// <param name="ackId">The ack Id</param>
345345
/// <param name="tracingId">The tracing Id of the message.</param>
346-
public LeaveGroupWithAckMessage(string connectionId, string groupName, int ackId, ulong? tracingId = null)
346+
public LeaveGroupWithAckMessage(string connectionId, string? groupName, int ackId, ulong? tracingId = null)
347347
{
348348
ConnectionId = connectionId;
349349
GroupName = groupName;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Text;
7+
8+
namespace System.Diagnostics.CodeAnalysis;
9+
10+
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
11+
internal sealed class DoesNotReturnAttribute : Attribute
12+
{
13+
}

src/Microsoft.Azure.SignalR.Protocols/Microsoft.Azure.SignalR.Protocols.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>Microsoft.Azure.SignalR.Protocol</RootNamespace>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7+
<Nullable>enable</Nullable>
78
</PropertyGroup>
89

910
<ItemGroup>

src/Microsoft.Azure.SignalR.Protocols/ServiceMessage.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public abstract class ServiceMessage
7171
/// </summary>
7272
public virtual ServiceMessage Clone() => (MemberwiseClone() as ServiceMessage)!;
7373

74-
public static byte GeneratePartitionKey(string input)
74+
public static byte GeneratePartitionKey(string? input)
7575
{
7676
return (byte)((input?.GetHashCode() ?? 0) & 0xFF);
7777
}
@@ -393,7 +393,7 @@ public class HandshakeResponseMessage : ExtensibleServiceMessage
393393
/// <summary>
394394
/// Gets or sets the optional error message.
395395
/// </summary>
396-
public string ErrorMessage { get; set; }
396+
public string? ErrorMessage { get; set; }
397397

398398
/// <summary>
399399
/// Gets or sets the id of this connection.
@@ -411,7 +411,7 @@ public HandshakeResponseMessage() : this(string.Empty)
411411
/// Initializes a new instance of the <see cref="HandshakeResponseMessage"/> class.
412412
/// </summary>
413413
/// <param name="errorMessage">An optional response error message. A <c>null</c> or empty error message indicates a successful handshake.</param>
414-
public HandshakeResponseMessage(string errorMessage)
414+
public HandshakeResponseMessage(string? errorMessage)
415415
{
416416
ErrorMessage = errorMessage;
417417
}
@@ -427,7 +427,7 @@ public class PingMessage : ServiceMessage
427427
/// </summary>
428428
public static PingMessage Instance = new PingMessage();
429429

430-
public string[] Messages { get; set; } = Array.Empty<string>();
430+
public string?[] Messages { get; set; } = Array.Empty<string?>();
431431
}
432432

433433
/// <summary>
@@ -444,9 +444,9 @@ public class ServiceErrorMessage : ServiceMessage
444444
/// Initializes a new instance of the <see cref="ServiceErrorMessage"/> class.
445445
/// </summary>
446446
/// <param name="errorMessage">An error message.</param>
447-
public ServiceErrorMessage(string errorMessage)
447+
public ServiceErrorMessage(string? errorMessage)
448448
{
449-
ErrorMessage = errorMessage;
449+
ErrorMessage = errorMessage ?? string.Empty;
450450
}
451451
}
452452

@@ -463,7 +463,7 @@ public class ServiceEventMessage : ExtensibleServiceMessage
463463
/// <summary>
464464
/// Gets or sets the id of event object.
465465
/// </summary>
466-
public string Id { get; set; }
466+
public string? Id { get; set; }
467467

468468
/// <summary>
469469
/// Gets or sets the kind of event.
@@ -482,12 +482,12 @@ public class ServiceEventMessage : ExtensibleServiceMessage
482482
/// <param name="id">An id of event object.</param>
483483
/// <param name="kind">A kind of event.</param>
484484
/// <param name="message">A message of event.</param>
485-
public ServiceEventMessage(ServiceEventObjectType type, string id, ServiceEventKind kind, string message)
485+
public ServiceEventMessage(ServiceEventObjectType type, string? id, ServiceEventKind kind, string? message)
486486
{
487487
Type = type;
488488
Id = id;
489489
Kind = kind;
490-
Message = message;
490+
Message = message ?? string.Empty;
491491
}
492492
}
493493

@@ -526,11 +526,11 @@ public AckMessage(int ackId, int status) : this(ackId, status, string.Empty)
526526
/// <param name="ackId">The ack Id</param>
527527
/// <param name="status">The status code</param>
528528
/// <param name="message">The ack message</param>
529-
public AckMessage(int ackId, int status, string message)
529+
public AckMessage(int ackId, int status, string? message)
530530
{
531531
AckId = ackId;
532532
Status = status;
533-
Message = message;
533+
Message = message ?? string.Empty;
534534
}
535535
}
536536

0 commit comments

Comments
 (0)