Skip to content
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
1 change: 1 addition & 0 deletions api/Microsoft.Azure.SignalR.Protocols.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ public GroupMemberQueryMessage() { }
public int AckId { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public string? ContinuationToken { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public string GroupName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public int? MaxPageSize { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public int? Top { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public ulong? TracingId { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
}
Expand Down
7 changes: 6 additions & 1 deletion src/Microsoft.Azure.SignalR.Protocols/ServiceMessage.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#nullable enable

Expand Down Expand Up @@ -590,6 +590,11 @@ public class GroupMemberQueryMessage : ExtensibleServiceMessage, IAckableMessage
/// </summary>
public string GroupName { get; set; } = string.Empty;

/// <summary>
/// The max size of a page.
/// </summary>
public int? MaxPageSize { get; set; }

/// <summary>
/// The max count of connections to return.
/// </summary>
Expand Down
16 changes: 14 additions & 2 deletions src/Microsoft.Azure.SignalR.Protocols/ServiceProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ private static void WriteConnectionFlowControlMessage(ref MessagePackWriter writ

private static void WriteGroupMemberQueryMessage(ref MessagePackWriter writer, GroupMemberQueryMessage message)
{
writer.WriteArrayHeader(6);
writer.WriteArrayHeader(7);
writer.Write(ServiceProtocolConstants.GroupMemberQueryMessageType);
message.WriteExtensionMembers(ref writer);
writer.Write(message.GroupName);
Expand All @@ -774,6 +774,14 @@ private static void WriteGroupMemberQueryMessage(ref MessagePackWriter writer, G
writer.WriteNil();
}
writer.Write(message.ContinuationToken);
if (message.MaxPageSize != null)
{
writer.Write(message.MaxPageSize.Value);
}
else
{
writer.WriteNil();
}
}

private static void WriteStringArray(ref MessagePackWriter writer, IReadOnlyList<string>? array)
Expand Down Expand Up @@ -1405,6 +1413,10 @@ private static GroupMemberQueryMessage CreateGroupMemberQueryMessage(ref Message
result.AckId = ReadInt32(ref reader, nameof(GroupMemberQueryMessage.AckId));
result.Top = reader.TryReadNil() ? null : ReadInt32(ref reader, nameof(GroupMemberQueryMessage.Top));
result.ContinuationToken = ReadString(ref reader, nameof(GroupMemberQueryMessage.ContinuationToken));
if (arrayLength >= 7)
{
result.MaxPageSize = reader.TryReadNil() ? null : ReadInt32(ref reader, nameof(GroupMemberQueryMessage.MaxPageSize));
}
return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ private static bool GroupMemberQueryMessageEqual(GroupMemberQueryMessage x, Grou
{
return x.AckId == y.AckId &&
StringEqual(x.GroupName, y.GroupName) &&
x.MaxPageSize == y.MaxPageSize &&
x.Top == y.Top &&
StringEqual(x.ContinuationToken, y.ContinuationToken) &&
x.TracingId == y.TracingId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ public static IEnumerable<object[]> TestParseOldData
["messagepack"] = new byte[] {7, 1, 2, 3, 4, 5, 6}
}, tracingId: 1234L),
binary: "lQ2mZ3JvdXAzkIKkanNvbsQHBgcBAgMEBattZXNzYWdlcGFja8QHBwECAwQFBoEBzQTS"),
new ProtocolTestData(
name: "GroupMemberQueryMessage",
message: new GroupMemberQueryMessage() { GroupName = "group", AckId = 1 },
binary: "liiApWdyb3VwAcDA"),
new ProtocolTestData(
name: "GroupMemberQueryMessageWithOptionalFields",
message: new GroupMemberQueryMessage() { GroupName = "group", AckId = 1, Top = 10, ContinuationToken = "token", TracingId = 1234UL },
binary: "liiBAc0E0qVncm91cAEKpXRva2Vu"),
}.ToDictionary(t => t.Name);

#pragma warning disable CS0618 // Type or member is obsolete
Expand Down Expand Up @@ -767,11 +775,11 @@ public static IEnumerable<object[]> TestParseOldData
new ProtocolTestData(
name: "GroupMemberQueryMessage",
message: new GroupMemberQueryMessage() { GroupName = "group", AckId = 1 },
binary: "liiApWdyb3VwAcDA"),
binary: "lyiApWdyb3VwAcDAwA=="),
new ProtocolTestData(
name: "GroupMemberQueryMessageWithOptionalFields",
message: new GroupMemberQueryMessage() { GroupName = "group", AckId = 1, Top = 10, ContinuationToken = "token", TracingId = 1234UL },
binary: "liiBAc0E0qVncm91cAEKpXRva2Vu"),
message: new GroupMemberQueryMessage() { GroupName = "group", AckId = 1, MaxPageSize = 5, Top = 10, ContinuationToken = "token", TracingId = 1234UL },
binary: "lyiBAc0E0qVncm91cAEKpXRva2VuBQ=="),
}.ToDictionary(t => t.Name);

#pragma warning restore CS0618 // Type or member is obsolete
Expand Down
Loading