From 13a3dfe8dcb07e3433d449ce176de54dc387bda1 Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Fri, 29 Jun 2018 09:50:47 -0700 Subject: [PATCH 01/12] Adding HubConnection Tests for the Java Client(#2550) --- .../signalr/src/main/java/HubConnection.java | 36 +++++---- .../src/test/java/HubConnectionTest.java | 77 ++++++++++++++++++- 2 files changed, 97 insertions(+), 16 deletions(-) diff --git a/clients/java/signalr/src/main/java/HubConnection.java b/clients/java/signalr/src/main/java/HubConnection.java index 5bf6f3d43e..68db2bf090 100644 --- a/clients/java/signalr/src/main/java/HubConnection.java +++ b/clients/java/signalr/src/main/java/HubConnection.java @@ -5,18 +5,18 @@ import java.net.URISyntaxException; import java.util.HashMap; public class HubConnection { - private String _url; - private Transport _transport; + private String url; + private Transport transport; private OnReceiveCallBack callback; private HashMap handlers = new HashMap<>(); private HubProtocol protocol; public Boolean connected = false; - public HubConnection(String url) { - _url = url; - protocol = new JsonHubProtocol(); - callback = (payload) -> { + public HubConnection(String url, Transport transport){ + this.url = url; + this.protocol = new JsonHubProtocol(); + this.callback = (payload) -> { InvocationMessage[] messages = protocol.parseMessages(payload); @@ -29,28 +29,36 @@ public class HubConnection { } }; - try { - _transport = new WebSocketTransport(_url); - } catch (URISyntaxException e) { - e.printStackTrace(); + if (transport == null){ + try { + this.transport = new WebSocketTransport(this.url); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + } else { + this.transport = transport; } } + public HubConnection(String url) { + this(url, null); + } + public void start() throws InterruptedException { - _transport.setOnReceive(this.callback); - _transport.start(); + transport.setOnReceive(this.callback); + transport.start(); connected = true; } public void stop(){ - _transport.stop(); + transport.stop(); connected = false; } public void send(String method, Object... args) { InvocationMessage invocationMessage = new InvocationMessage(method, args); String message = protocol.writeMessage(invocationMessage); - _transport.send(message); + transport.send(message); } public void On(String target, Action callback) { diff --git a/clients/java/signalr/src/test/java/HubConnectionTest.java b/clients/java/signalr/src/test/java/HubConnectionTest.java index b3868ac885..ec55e3f875 100644 --- a/clients/java/signalr/src/test/java/HubConnectionTest.java +++ b/clients/java/signalr/src/test/java/HubConnectionTest.java @@ -1,13 +1,86 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +import com.google.gson.JsonArray; import org.junit.Test; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + import static org.junit.Assert.*; public class HubConnectionTest { - // Coming soon! @Test - public void testEmptyCollection() { + public void checkHubConnectionState() throws InterruptedException { + Transport mockTransport = new MockEchoTransport(); + HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); + hubConnection.start(); + assertTrue(hubConnection.connected); + + hubConnection.stop(); + assertFalse(hubConnection.connected); + } + + @Test + public void SendWithNoParamsTriggersOnHandler() throws InterruptedException { + AtomicInteger value = new AtomicInteger(0); + Transport mockTransport = new MockEchoTransport(); + HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); + + Action callback = (param) -> { + assertEquals(0, value.get()); + value.incrementAndGet(); + }; + hubConnection.On("inc", callback); + + hubConnection.start(); + hubConnection.send("inc"); + + // Confirming that our handler was called and that the counter property was incremented. + assertEquals(1, value.get()); + } + + @Test + public void SendWithParamTriggersOnHandler() throws InterruptedException { + AtomicReference value = new AtomicReference<>(); + Transport mockTransport = new MockEchoTransport(); + HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); + + Action callback = (param) -> { + assertNull(value.get()); + value.set(((JsonArray) param).get(0).getAsString()); + }; + hubConnection.On("inc", callback); + + hubConnection.start(); + hubConnection.send("inc", "Hello World"); + + // Confirming that our handler was called and the correct message was passed in. + assertEquals("Hello World", value.get()); + } + + private class MockEchoTransport implements Transport { + private OnReceiveCallBack onReceiveCallBack; + + @Override + public void start() {} + + @Override + public void send(String message) { + this.onReceive(message); + } + + @Override + public void setOnReceive(OnReceiveCallBack callback) { + this.onReceiveCallBack = callback; + } + + @Override + public void onReceive(String message) { + this.onReceiveCallBack.invoke(message); + } + + @Override + public void stop() {return;} } } \ No newline at end of file From 9d179ed82b7756515a4d0348542c8bbe643d3ff0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 29 Jun 2018 13:56:56 -0700 Subject: [PATCH 02/12] Bumping version to 3.0.0 --- version.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/version.props b/version.props index 573566501b..71a78cddd8 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ - + - 1.1.0 - preview1 + 3.0.0 + alpha1 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From 422997a59a272e8c7826520c0c1a97e8b714d601 Mon Sep 17 00:00:00 2001 From: "Nate McMaster (automated)" Date: Mon, 2 Jul 2018 12:40:37 -0700 Subject: [PATCH 03/12] [automated] Change default branch to master --- .travis.yml | 2 +- .vsts-pipelines/builds/ci-internal.yml | 4 ++-- .vsts-pipelines/builds/ci-public.yml | 4 ++-- .vsts-pipelines/builds/slow-tests-internal.yml | 2 +- korebuild.json | 4 ++-- run.ps1 | 6 +++--- run.sh | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 06281bb0ef..537cb2cac5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ addons: - libunwind8 branches: only: - - dev + - master - /^release\/.*$/ - /^(.*\/)?ci-.*$/ before_install: diff --git a/.vsts-pipelines/builds/ci-internal.yml b/.vsts-pipelines/builds/ci-internal.yml index dede2700c7..86145193a5 100644 --- a/.vsts-pipelines/builds/ci-internal.yml +++ b/.vsts-pipelines/builds/ci-internal.yml @@ -1,5 +1,5 @@ trigger: -- dev +- master - release/* resources: @@ -7,7 +7,7 @@ resources: - repository: buildtools type: git name: aspnet-BuildTools - ref: refs/heads/dev + ref: refs/heads/master phases: - template: .vsts-pipelines/templates/phases/default-build.yml@buildtools diff --git a/.vsts-pipelines/builds/ci-public.yml b/.vsts-pipelines/builds/ci-public.yml index a310fa5b88..bc06c7a25a 100644 --- a/.vsts-pipelines/builds/ci-public.yml +++ b/.vsts-pipelines/builds/ci-public.yml @@ -1,5 +1,5 @@ trigger: -- dev +- master - release/* # See https://github.com/aspnet/BuildTools @@ -9,7 +9,7 @@ resources: type: github endpoint: DotNet-Bot GitHub Connection name: aspnet/BuildTools - ref: refs/heads/dev + ref: refs/heads/master phases: - template: .vsts-pipelines/templates/phases/default-build.yml@buildtools diff --git a/.vsts-pipelines/builds/slow-tests-internal.yml b/.vsts-pipelines/builds/slow-tests-internal.yml index 7706248606..dbb62aacfb 100644 --- a/.vsts-pipelines/builds/slow-tests-internal.yml +++ b/.vsts-pipelines/builds/slow-tests-internal.yml @@ -1,5 +1,5 @@ trigger: -- dev +- master - release/* phases: diff --git a/korebuild.json b/korebuild.json index 19b76654e1..ce2e15a055 100644 --- a/korebuild.json +++ b/korebuild.json @@ -1,6 +1,6 @@ { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json", + "channel": "master", "toolsets": { "nodejs": { "required": true, diff --git a/run.ps1 b/run.ps1 index 3b27382468..34604c7175 100644 --- a/run.ps1 +++ b/run.ps1 @@ -52,8 +52,8 @@ in the file are overridden by command line parameters. Example config file: ```json { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json", + "channel": "master", "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" } ``` @@ -192,7 +192,7 @@ if (!$DotNetHome) { else { Join-Path $PSScriptRoot '.dotnet'} } -if (!$Channel) { $Channel = 'dev' } +if (!$Channel) { $Channel = 'master' } if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } # Execute diff --git a/run.sh b/run.sh index 02aac15874..61f7a53385 100755 --- a/run.sh +++ b/run.sh @@ -248,7 +248,7 @@ if [ -f "$config_file" ]; then [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" fi -[ -z "$channel" ] && channel='dev' +[ -z "$channel" ] && channel='master' [ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' get_korebuild From e8cc38f8878dc12b9b7574177d78c2160fcc8551 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Tue, 3 Jul 2018 16:28:24 +0000 Subject: [PATCH 04/12] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 100 +++++++++++++++++++-------------------- korebuild-lock.txt | 4 +- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index aa2544b303..7583ca3224 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,63 +5,63 @@ 0.10.13 3.1.0 - 2.2.0-preview1-34530 - 2.2.0-preview1-17090 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10000 1.7.3.4 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 4.6.0-preview1-26617-01 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 - 2.2.0-preview1-34530 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 + 3.0.0-alpha1-10016 2.2.0-preview1-26618-02 15.6.1 4.7.49 2.0.3 11.0.2 - 1.2.4 + 1.2.6 4.6.0-preview1-26617-01 4.6.0-preview1-26617-01 4.6.0-preview1-26617-01 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3e694b2ed8..3f870e51fe 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.2.0-preview1-17090 -commithash:b19e903e946579cd9482089bce7d917e8bacd765 +version:3.0.0-alpha1-10000 +commithash:b7b88d08d55abc8b71de9abf16e26fc713e332cd From c526f489ce836f715aadbf40b93e4c88cdcc962b Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Tue, 3 Jul 2018 11:12:24 -0700 Subject: [PATCH 05/12] Adding Support for On Overloads in Java Client (#2568) --- .../java/signalr/src/main/java/Action.java | 6 +- .../java/signalr/src/main/java/Action1.java | 6 + .../java/signalr/src/main/java/Action2.java | 6 + .../java/signalr/src/main/java/Action3.java | 6 + .../java/signalr/src/main/java/Action4.java | 6 + .../java/signalr/src/main/java/Action5.java | 6 + .../signalr/src/main/java/ActionBase.java | 6 + clients/java/signalr/src/main/java/Chat.java | 12 +- .../signalr/src/main/java/HubConnection.java | 52 +++++- .../src/main/java/OnReceiveCallBack.java | 2 +- .../java/signalr/src/main/java/Transport.java | 4 +- .../src/main/java/WebSocketTransport.java | 8 +- .../src/test/java/HubConnectionTest.java | 152 ++++++++++++++++-- 13 files changed, 234 insertions(+), 38 deletions(-) create mode 100644 clients/java/signalr/src/main/java/Action1.java create mode 100644 clients/java/signalr/src/main/java/Action2.java create mode 100644 clients/java/signalr/src/main/java/Action3.java create mode 100644 clients/java/signalr/src/main/java/Action4.java create mode 100644 clients/java/signalr/src/main/java/Action5.java create mode 100644 clients/java/signalr/src/main/java/ActionBase.java diff --git a/clients/java/signalr/src/main/java/Action.java b/clients/java/signalr/src/main/java/Action.java index 79c4da61a2..8d41276eb6 100644 --- a/clients/java/signalr/src/main/java/Action.java +++ b/clients/java/signalr/src/main/java/Action.java @@ -1,6 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -public interface Action { - void invoke(T param); -} \ No newline at end of file +public interface Action { + void invoke(); +} diff --git a/clients/java/signalr/src/main/java/Action1.java b/clients/java/signalr/src/main/java/Action1.java new file mode 100644 index 0000000000..ae4c4d7cbb --- /dev/null +++ b/clients/java/signalr/src/main/java/Action1.java @@ -0,0 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +public interface Action1 { + void invoke(T1 param1); +} diff --git a/clients/java/signalr/src/main/java/Action2.java b/clients/java/signalr/src/main/java/Action2.java new file mode 100644 index 0000000000..41ab3b123f --- /dev/null +++ b/clients/java/signalr/src/main/java/Action2.java @@ -0,0 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +public interface Action2 { + void invoke(T1 param1, T2 param2); +} diff --git a/clients/java/signalr/src/main/java/Action3.java b/clients/java/signalr/src/main/java/Action3.java new file mode 100644 index 0000000000..b79e6449df --- /dev/null +++ b/clients/java/signalr/src/main/java/Action3.java @@ -0,0 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +public interface Action3 { + void invoke(T1 param1, T2 param2, T3 param3); +} diff --git a/clients/java/signalr/src/main/java/Action4.java b/clients/java/signalr/src/main/java/Action4.java new file mode 100644 index 0000000000..34665d8fd6 --- /dev/null +++ b/clients/java/signalr/src/main/java/Action4.java @@ -0,0 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +public interface Action4 { + void invoke(T1 param1, T2 param2, T3 param3, T4 param4); +} diff --git a/clients/java/signalr/src/main/java/Action5.java b/clients/java/signalr/src/main/java/Action5.java new file mode 100644 index 0000000000..446aa52132 --- /dev/null +++ b/clients/java/signalr/src/main/java/Action5.java @@ -0,0 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +public interface Action5 { + void invoke(T1 param1, T2 param2, T3 param3, T4 param4, T5 param5); +} diff --git a/clients/java/signalr/src/main/java/ActionBase.java b/clients/java/signalr/src/main/java/ActionBase.java new file mode 100644 index 0000000000..09b1bc7cfb --- /dev/null +++ b/clients/java/signalr/src/main/java/ActionBase.java @@ -0,0 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +public interface ActionBase { + void invoke(Object ... params); +} diff --git a/clients/java/signalr/src/main/java/Chat.java b/clients/java/signalr/src/main/java/Chat.java index a64b107c94..a7ce9f9738 100644 --- a/clients/java/signalr/src/main/java/Chat.java +++ b/clients/java/signalr/src/main/java/Chat.java @@ -1,23 +1,19 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -import com.google.gson.JsonArray; - -import java.net.URISyntaxException; import java.util.Scanner; public class Chat { - public static void main(String[] args) throws URISyntaxException, InterruptedException { + public static void main(String[] args) throws Exception { System.out.println("Enter the URL of the SignalR Chat you want to join"); Scanner reader = new Scanner(System.in); // Reading from System.in String input; input = reader.nextLine(); HubConnection hubConnection = new HubConnection(input); - hubConnection.On("Send", (message) -> { - String newMessage = ((JsonArray) message).get(0).getAsString(); - System.out.println("REGISTERED HANDLER: " + newMessage); - }); + hubConnection.on("Send", (message) -> { + System.out.println("REGISTERED HANDLER: " + message); + }, String.class); //This is a blocking call hubConnection.start(); diff --git a/clients/java/signalr/src/main/java/HubConnection.java b/clients/java/signalr/src/main/java/HubConnection.java index 68db2bf090..b33df34019 100644 --- a/clients/java/signalr/src/main/java/HubConnection.java +++ b/clients/java/signalr/src/main/java/HubConnection.java @@ -1,15 +1,20 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +import com.google.gson.Gson; +import com.google.gson.JsonArray; + import java.net.URISyntaxException; +import java.util.ArrayList; import java.util.HashMap; public class HubConnection { private String url; private Transport transport; private OnReceiveCallBack callback; - private HashMap handlers = new HashMap<>(); + private HashMap handlers = new HashMap<>(); private HubProtocol protocol; + private Gson gson = new Gson(); public Boolean connected = false; @@ -24,7 +29,9 @@ public class HubConnection { // Adding this to avoid getting error messages on pings for now. for (InvocationMessage message : messages) { if (message != null && handlers.containsKey(message.target)) { - handlers.get(message.target).invoke(message.arguments[0]); + ArrayList types = gson.fromJson((JsonArray)message.arguments[0], (new ArrayList()).getClass()); + + handlers.get(message.target).invoke(types.toArray()); } } }; @@ -55,13 +62,48 @@ public class HubConnection { connected = false; } - public void send(String method, Object... args) { + public void send(String method, Object... args) throws Exception { InvocationMessage invocationMessage = new InvocationMessage(method, args); String message = protocol.writeMessage(invocationMessage); transport.send(message); } - public void On(String target, Action callback) { - handlers.put(target, callback); + public void on(String target, Action callback) { + ActionBase ac = args -> callback.invoke(); + handlers.put(target, ac); + } + + public void on(String target, Action1 callback, Class param1) { + ActionBase ac = params -> callback.invoke(param1.cast(params[0])); + handlers.put(target, ac); + } + + public void on(String target, Action2 callback, Class param1, Class param2) { + ActionBase action = params -> { + callback.invoke(param1.cast(params[0]), param2.cast(params[1])); + }; + handlers.put(target, action); + } + + public void on(String target, Action3 callback, Class param1, Class param2, Class param3) { + ActionBase action = params -> { + callback.invoke(param1.cast(params[0]), param2.cast(params[1]), param3.cast(params[2])); + }; + handlers.put(target, action); + } + + public void on(String target, Action4 callback, Class param1, Class param2, Class param3, Class param4) { + ActionBase action = params -> { + callback.invoke(param1.cast(params[0]), param2.cast(params[1]), param3.cast(params[2]), param4.cast(params[3])); + }; + handlers.put(target, action); + } + + public void on(String target, Action5 callback, Class param1, Class param2, Class param3, Class param4, Class param5) { + ActionBase action = params -> { + callback.invoke(param1.cast(params[0]), param2.cast(params[1]), param3.cast(params[2]), param4.cast(params[3]), + param5.cast(params[4])); + }; + handlers.put(target, action); } } \ No newline at end of file diff --git a/clients/java/signalr/src/main/java/OnReceiveCallBack.java b/clients/java/signalr/src/main/java/OnReceiveCallBack.java index e461b47c1a..6d971d1955 100644 --- a/clients/java/signalr/src/main/java/OnReceiveCallBack.java +++ b/clients/java/signalr/src/main/java/OnReceiveCallBack.java @@ -4,5 +4,5 @@ import com.google.gson.JsonObject; public interface OnReceiveCallBack { - void invoke(String message); + void invoke(String message) throws Exception; } diff --git a/clients/java/signalr/src/main/java/Transport.java b/clients/java/signalr/src/main/java/Transport.java index 819460b9d1..240675dfe5 100644 --- a/clients/java/signalr/src/main/java/Transport.java +++ b/clients/java/signalr/src/main/java/Transport.java @@ -3,8 +3,8 @@ public interface Transport { void start() throws InterruptedException; - void send(String message); + void send(String message) throws Exception; void setOnReceive(OnReceiveCallBack callback); - void onReceive(String message); + void onReceive(String message) throws Exception; void stop(); } diff --git a/clients/java/signalr/src/main/java/WebSocketTransport.java b/clients/java/signalr/src/main/java/WebSocketTransport.java index 1fa6a68b70..f1218785c2 100644 --- a/clients/java/signalr/src/main/java/WebSocketTransport.java +++ b/clients/java/signalr/src/main/java/WebSocketTransport.java @@ -36,7 +36,7 @@ public class WebSocketTransport implements Transport { } @Override - public void onReceive(String message) { + public void onReceive(String message) throws Exception { this.onReceiveCallBack.invoke(message); } @@ -54,7 +54,11 @@ public class WebSocketTransport implements Transport { @Override public void onMessage(String message) { - onReceive(message); + try { + onReceive(message); + } catch (Exception e) { + e.printStackTrace(); + } } @Override diff --git a/clients/java/signalr/src/test/java/HubConnectionTest.java b/clients/java/signalr/src/test/java/HubConnectionTest.java index ec55e3f875..e50ab7a647 100644 --- a/clients/java/signalr/src/test/java/HubConnectionTest.java +++ b/clients/java/signalr/src/test/java/HubConnectionTest.java @@ -1,10 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -import com.google.gson.JsonArray; import org.junit.Test; -import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import static org.junit.Assert.*; @@ -21,36 +19,36 @@ public class HubConnectionTest { assertFalse(hubConnection.connected); } + // We're using AtomicReference in the send tests instead of int here because Gson has trouble deserializing to Integer @Test - public void SendWithNoParamsTriggersOnHandler() throws InterruptedException { - AtomicInteger value = new AtomicInteger(0); + public void SendWithNoParamsTriggersOnHandler() throws Exception { + + AtomicReference value = new AtomicReference(0.0); Transport mockTransport = new MockEchoTransport(); HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); - Action callback = (param) -> { - assertEquals(0, value.get()); - value.incrementAndGet(); - }; - hubConnection.On("inc", callback); + hubConnection.on("inc", () ->{ + assertEquals(0.0, value.get(), 0); + value.getAndSet(value.get() + 1); + }); hubConnection.start(); hubConnection.send("inc"); // Confirming that our handler was called and that the counter property was incremented. - assertEquals(1, value.get()); + assertEquals(1, value.get(), 0); } @Test - public void SendWithParamTriggersOnHandler() throws InterruptedException { + public void SendWithParamTriggersOnHandler() throws Exception { AtomicReference value = new AtomicReference<>(); Transport mockTransport = new MockEchoTransport(); HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); - Action callback = (param) -> { + hubConnection.on("inc", (param) ->{ assertNull(value.get()); - value.set(((JsonArray) param).get(0).getAsString()); - }; - hubConnection.On("inc", callback); + value.set(param); + }, String.class); hubConnection.start(); hubConnection.send("inc", "Hello World"); @@ -59,6 +57,126 @@ public class HubConnectionTest { assertEquals("Hello World", value.get()); } + @Test + public void SendWithTwoParamsTriggersOnHandler() throws Exception { + AtomicReference value1 = new AtomicReference<>(); + AtomicReference value2 = new AtomicReference<>(); + + Transport mockTransport = new MockEchoTransport(); + HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); + + hubConnection.on("inc", (param1, param2) ->{ + assertNull(value1.get()); + assertNull((value2.get())); + + value1.set(param1); + value2.set(param2); + }, String.class, Double.class); + + hubConnection.start(); + hubConnection.send("inc", "Hello World", 12); + + // Confirming that our handler was called and the correct message was passed in. + assertEquals("Hello World", value1.get()); + assertEquals(12, value2.get(), 0); + } + + @Test + public void SendWithThreeParamsTriggersOnHandler() throws Exception { + AtomicReference value1 = new AtomicReference<>(); + AtomicReference value2 = new AtomicReference<>(); + AtomicReference value3 = new AtomicReference<>(); + + Transport mockTransport = new MockEchoTransport(); + HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); + + hubConnection.on("inc", (param1, param2, param3) ->{ + assertNull(value1.get()); + assertNull(value2.get()); + assertNull(value3.get()); + + value1.set(param1); + value2.set(param2); + value3.set(param3); + }, String.class, String.class, String.class); + + hubConnection.start(); + hubConnection.send("inc", "A", "B", "C"); + + // Confirming that our handler was called and the correct message was passed in. + assertEquals("A", value1.get()); + assertEquals("B", value2.get()); + assertEquals("C", value3.get()); + } + + @Test + public void SendWithFourParamsTriggersOnHandler() throws Exception { + AtomicReference value1 = new AtomicReference<>(); + AtomicReference value2 = new AtomicReference<>(); + AtomicReference value3 = new AtomicReference<>(); + AtomicReference value4 = new AtomicReference<>(); + + Transport mockTransport = new MockEchoTransport(); + HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); + + hubConnection.on("inc", (param1, param2, param3, param4) ->{ + assertNull(value1.get()); + assertNull(value2.get()); + assertNull(value3.get()); + assertNull(value4.get()); + + value1.set(param1); + value2.set(param2); + value3.set(param3); + value4.set(param4); + }, String.class, String.class, String.class, String.class); + + hubConnection.start(); + hubConnection.send("inc", "A", "B", "C", "D"); + + // Confirming that our handler was called and the correct message was passed in. + assertEquals("A", value1.get()); + assertEquals("B", value2.get()); + assertEquals("C", value3.get()); + assertEquals("D", value4.get()); + } + + @Test + public void SendWithFiveParamsTriggersOnHandler() throws Exception { + AtomicReference value1 = new AtomicReference<>(); + AtomicReference value2 = new AtomicReference<>(); + AtomicReference value3 = new AtomicReference<>(); + AtomicReference value4 = new AtomicReference<>(); + AtomicReference value5 = new AtomicReference<>(); + + Transport mockTransport = new MockEchoTransport(); + HubConnection hubConnection = new HubConnection("http://example.com", mockTransport); + + hubConnection.on("inc", (param1, param2, param3, param4, param5) ->{ + assertNull(value1.get()); + assertNull(value2.get()); + assertNull(value3.get()); + assertNull(value4.get()); + assertNull(value5.get()); + + value1.set(param1); + value2.set(param2); + value3.set(param3); + value4.set(param4); + value5.set(param5); + }, String.class, String.class, String.class, Boolean.class, Double.class); + + hubConnection.start(); + hubConnection.send("inc", "A", "B", "C", true, 12.0); + + // Confirming that our handler was called and the correct message was passed in. + assertEquals("A", value1.get()); + assertEquals("B", value2.get()); + assertEquals("C", value3.get()); + assertTrue(value4.get()); + assertEquals(12, value5.get(), 0); + } + private class MockEchoTransport implements Transport { private OnReceiveCallBack onReceiveCallBack; @@ -66,7 +184,7 @@ public class HubConnectionTest { public void start() {} @Override - public void send(String message) { + public void send(String message) throws Exception { this.onReceive(message); } @@ -76,7 +194,7 @@ public class HubConnectionTest { } @Override - public void onReceive(String message) { + public void onReceive(String message) throws Exception { this.onReceiveCallBack.invoke(message); } From 748e9928651e047d5e9e1e7020f3cd3985496b3d Mon Sep 17 00:00:00 2001 From: Dylan Dmitri Gray Date: Thu, 5 Jul 2018 16:42:42 -0700 Subject: [PATCH 06/12] Dygray/handshake versioning (#2520) * set minor versions on the protocols --- .../DefaultHubDispatcherBenchmark.cs | 1 + .../RedisHubLifetimeManagerBenchmark.cs | 1 + .../RedisProtocolBenchmark.cs | 1 + .../HubConnection.cs | 11 +++-- .../Protocol/HandshakeProtocol.cs | 42 ++++++++++++------- .../Protocol/HandshakeResponseMessage.cs | 29 +++++++++++-- .../Protocol/IHubProtocol.cs | 7 +++- .../breakingchanges.netcore.json | 12 ++++++ .../HubConnectionContext.cs | 8 ++-- .../Protocol/JsonHubProtocol.cs | 4 ++ .../Protocol/MessagePackHubProtocol.cs | 6 ++- .../VersionJsonHubProtocol.cs | 1 + .../HubConnectionTests.Protocol.cs | 22 ++++++++++ .../HubConnectionTests.cs | 1 + .../TestConnection.cs | 4 +- .../Protocol/HandshakeProtocolTests.cs | 11 +++++ .../DummyHubProtocol.cs | 1 + .../TestClient.cs | 2 +- .../HubConnectionHandlerTestUtils/Utils.cs | 4 +- .../HubConnectionHandlerTests.cs | 24 +++++++++++ 20 files changed, 159 insertions(+), 33 deletions(-) create mode 100644 src/Microsoft.AspNetCore.SignalR.Common/breakingchanges.netcore.json diff --git a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/DefaultHubDispatcherBenchmark.cs b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/DefaultHubDispatcherBenchmark.cs index 3da8b6d0cc..d7431ed28b 100644 --- a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/DefaultHubDispatcherBenchmark.cs +++ b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/DefaultHubDispatcherBenchmark.cs @@ -54,6 +54,7 @@ namespace Microsoft.AspNetCore.SignalR.Microbenchmarks { public string Name { get; } public int Version => 1; + public int MinorVersion => 0; public TransferFormat TransferFormat { get; } public bool IsVersionSupported(int version) diff --git a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisHubLifetimeManagerBenchmark.cs b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisHubLifetimeManagerBenchmark.cs index 3e333ddd74..b0eea531bb 100644 --- a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisHubLifetimeManagerBenchmark.cs +++ b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisHubLifetimeManagerBenchmark.cs @@ -177,6 +177,7 @@ namespace Microsoft.AspNetCore.SignalR.Microbenchmarks public string Name => _name; public int Version => _innerProtocol.Version; + public int MinorVersion => _innerProtocol.MinorVersion; public TransferFormat TransferFormat => _innerProtocol.TransferFormat; diff --git a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisProtocolBenchmark.cs b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisProtocolBenchmark.cs index 3008ed999c..1f72f922fe 100644 --- a/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisProtocolBenchmark.cs +++ b/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/RedisProtocolBenchmark.cs @@ -126,6 +126,7 @@ namespace Microsoft.AspNetCore.SignalR.Microbenchmarks public string Name { get; } public int Version => 1; + public int MinorVersion => 0; public TransferFormat TransferFormat => TransferFormat.Text; diff --git a/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs b/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs index 2ccf688ca0..47f4adf4c6 100644 --- a/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs +++ b/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs @@ -52,6 +52,7 @@ namespace Microsoft.AspNetCore.SignalR.Client // Transient state to a connection private ConnectionState _connectionState; + private int _serverProtocolMinorVersion; public event Func Closed; @@ -721,6 +722,8 @@ namespace Microsoft.AspNetCore.SignalR.Client $"Unable to complete handshake with the server due to an error: {message.Error}"); } + _serverProtocolMinorVersion = message.MinorVersion; + break; } } @@ -739,11 +742,12 @@ namespace Microsoft.AspNetCore.SignalR.Client } } } + + // shutdown if we're unable to read handshake // Ignore HubException because we throw it when we receive a handshake response with an error - // And we don't need to log that the handshake failed + // And because we already have the error, we don't need to log that the handshake failed catch (Exception ex) when (!(ex is HubException)) { - // shutdown if we're unable to read handshake Log.ErrorReceivingHandshakeResponse(_logger, ex); throw; } @@ -816,7 +820,7 @@ namespace Microsoft.AspNetCore.SignalR.Client finally { // The buffer was sliced up to where it was consumed, so we can just advance to the start. - // We mark examined as buffer.End so that if we didn't receive a full frame, we'll wait for more data + // We mark examined as `buffer.End` so that if we didn't receive a full frame, we'll wait for more data // before yielding the read again. connectionState.Connection.Transport.Input.AdvanceTo(buffer.Start, buffer.End); } @@ -865,7 +869,6 @@ namespace Microsoft.AspNetCore.SignalR.Client // There is no need to start a new task if there is no Closed event registered if (closed != null) { - // Fire-and-forget the closed event _ = RunClosedEvent(closed, connectionState.CloseException); } diff --git a/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeProtocol.cs b/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeProtocol.cs index 89e72f3ece..c661990524 100644 --- a/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeProtocol.cs +++ b/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeProtocol.cs @@ -3,7 +3,9 @@ using System; using System.Buffers; +using System.Collections.Concurrent; using System.IO; +using System.Text; using Microsoft.AspNetCore.Internal; using Microsoft.AspNetCore.SignalR.Internal; using Newtonsoft.Json; @@ -17,26 +19,31 @@ namespace Microsoft.AspNetCore.SignalR.Protocol { private const string ProtocolPropertyName = "protocol"; private const string ProtocolVersionPropertyName = "version"; + private const string MinorVersionPropertyName = "minorVersion"; private const string ErrorPropertyName = "error"; private const string TypePropertyName = "type"; - /// - /// The serialized representation of a success handshake. - /// - public static ReadOnlyMemory SuccessHandshakeData; + private static ConcurrentDictionary> _messageCache = new ConcurrentDictionary>(); - static HandshakeProtocol() + public static ReadOnlySpan GetSuccessfulHandshake(IHubProtocol protocol) { - var memoryBufferWriter = MemoryBufferWriter.Get(); - try + ReadOnlyMemory result; + if(!_messageCache.TryGetValue(protocol, out result)) { - WriteResponseMessage(HandshakeResponseMessage.Empty, memoryBufferWriter); - SuccessHandshakeData = memoryBufferWriter.ToArray(); - } - finally - { - MemoryBufferWriter.Return(memoryBufferWriter); + var memoryBufferWriter = MemoryBufferWriter.Get(); + try + { + WriteResponseMessage(new HandshakeResponseMessage(protocol.MinorVersion), memoryBufferWriter); + result = memoryBufferWriter.ToArray(); + _messageCache.TryAdd(protocol, result); + } + finally + { + MemoryBufferWriter.Return(memoryBufferWriter); + } } + + return result.Span; } /// @@ -87,6 +94,9 @@ namespace Microsoft.AspNetCore.SignalR.Protocol writer.WriteValue(responseMessage.Error); } + writer.WritePropertyName(MinorVersionPropertyName); + writer.WriteValue(responseMessage.MinorVersion); + writer.WriteEndObject(); writer.Flush(); } @@ -122,6 +132,7 @@ namespace Microsoft.AspNetCore.SignalR.Protocol JsonUtils.CheckRead(reader); JsonUtils.EnsureObjectStart(reader); + int? minorVersion = null; string error = null; var completed = false; @@ -141,6 +152,9 @@ namespace Microsoft.AspNetCore.SignalR.Protocol case ErrorPropertyName: error = JsonUtils.ReadAsString(reader, ErrorPropertyName); break; + case MinorVersionPropertyName: + minorVersion = JsonUtils.ReadAsInt32(reader, MinorVersionPropertyName); + break; default: reader.Skip(); break; @@ -154,7 +168,7 @@ namespace Microsoft.AspNetCore.SignalR.Protocol } }; - responseMessage = (error != null) ? new HandshakeResponseMessage(error) : HandshakeResponseMessage.Empty; + responseMessage = new HandshakeResponseMessage(minorVersion, error); return true; } } diff --git a/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeResponseMessage.cs b/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeResponseMessage.cs index 4288ea94e2..9e2454bbe9 100644 --- a/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeResponseMessage.cs +++ b/src/Microsoft.AspNetCore.SignalR.Common/Protocol/HandshakeResponseMessage.cs @@ -11,20 +11,41 @@ namespace Microsoft.AspNetCore.SignalR.Protocol /// /// An empty response message with no error. /// - public static readonly HandshakeResponseMessage Empty = new HandshakeResponseMessage(null); + public static readonly HandshakeResponseMessage Empty = new HandshakeResponseMessage(error: null); /// /// Gets the optional error message. /// public string Error { get; } + /// + /// Highest minor protocol version that the server supports. + /// + public int MinorVersion { get; } + + /// + /// Initializes a new instance of the class. + /// An error response does need a minor version. Since the handshake has failed, any extra data will be ignored. + /// + /// Error encountered by the server, indicating why the handshake has failed. + public HandshakeResponseMessage(string error) : this(null, error) { } + + /// + /// Initializes a new instance of the class. + /// A reponse with a minor version indicates success, and doesn't require an error field. + /// + /// The highest protocol minor version that the server supports. + public HandshakeResponseMessage(int minorVersion) : this(minorVersion, null) { } + /// /// Initializes a new instance of the class. /// - /// An optional response error message. A null error message indicates a succesful handshake. - public HandshakeResponseMessage(string error) + /// Error encountered by the server, indicating why the handshake has failed. + /// The highest protocol minor version that the server supports. + public HandshakeResponseMessage(int? minorVersion, string error) { - // Note that a response with an empty string for error in the JSON is considered an errored response + // MinorVersion defaults to 0, because old servers don't send a minor version + MinorVersion = minorVersion ?? 0; Error = error; } } diff --git a/src/Microsoft.AspNetCore.SignalR.Common/Protocol/IHubProtocol.cs b/src/Microsoft.AspNetCore.SignalR.Common/Protocol/IHubProtocol.cs index 7aaedc65fa..99b7fe5d36 100644 --- a/src/Microsoft.AspNetCore.SignalR.Common/Protocol/IHubProtocol.cs +++ b/src/Microsoft.AspNetCore.SignalR.Common/Protocol/IHubProtocol.cs @@ -18,10 +18,15 @@ namespace Microsoft.AspNetCore.SignalR.Protocol string Name { get; } /// - /// Gets the version of the protocol. + /// Gets the major version of the protocol. /// int Version { get; } + /// + /// Gets the minor version of the protocol. + /// + int MinorVersion { get; } + /// /// Gets the transfer format of the protocol. /// diff --git a/src/Microsoft.AspNetCore.SignalR.Common/breakingchanges.netcore.json b/src/Microsoft.AspNetCore.SignalR.Common/breakingchanges.netcore.json new file mode 100644 index 0000000000..3cd71f82e7 --- /dev/null +++ b/src/Microsoft.AspNetCore.SignalR.Common/breakingchanges.netcore.json @@ -0,0 +1,12 @@ +[ + { + "TypeId": "public static class Microsoft.AspNetCore.SignalR.Protocol.HandshakeProtocol", + "MemberId": "public static System.ReadOnlyMemory SuccessHandshakeData", + "Kind": "Removal" + }, + { + "TypeId": "public interface Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol", + "MemberId": "System.Int32 get_MinorVersion()", + "Kind": "Addition" + } +] \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.SignalR.Core/HubConnectionContext.cs b/src/Microsoft.AspNetCore.SignalR.Core/HubConnectionContext.cs index 768edbf132..50b73dd824 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/HubConnectionContext.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/HubConnectionContext.cs @@ -282,10 +282,9 @@ namespace Microsoft.AspNetCore.SignalR try { - if (message == HandshakeResponseMessage.Empty) + if (message.Error == null) { - // success response is always an empty object so send cached data - _connectionContext.Transport.Output.Write(HandshakeProtocol.SuccessHandshakeData.Span); + _connectionContext.Transport.Output.Write(HandshakeProtocol.GetSuccessfulHandshake(Protocol)); } else { @@ -398,7 +397,8 @@ namespace Microsoft.AspNetCore.SignalR } Log.HandshakeComplete(_logger, Protocol.Name); - await WriteHandshakeResponseAsync(HandshakeResponseMessage.Empty); + + await WriteHandshakeResponseAsync(new HandshakeResponseMessage(Protocol.MinorVersion)); return true; } } diff --git a/src/Microsoft.AspNetCore.SignalR.Protocols.Json/Protocol/JsonHubProtocol.cs b/src/Microsoft.AspNetCore.SignalR.Protocols.Json/Protocol/JsonHubProtocol.cs index e6ea079714..54400a2199 100644 --- a/src/Microsoft.AspNetCore.SignalR.Protocols.Json/Protocol/JsonHubProtocol.cs +++ b/src/Microsoft.AspNetCore.SignalR.Protocols.Json/Protocol/JsonHubProtocol.cs @@ -32,6 +32,7 @@ namespace Microsoft.AspNetCore.SignalR.Protocol private static readonly string ProtocolName = "json"; private static readonly int ProtocolVersion = 1; + private static readonly int ProtocolMinorVersion = 0; /// /// Gets the serializer used to serialize invocation arguments and return values. @@ -60,6 +61,9 @@ namespace Microsoft.AspNetCore.SignalR.Protocol /// public int Version => ProtocolVersion; + /// + public int MinorVersion => ProtocolMinorVersion; + /// public TransferFormat TransferFormat => TransferFormat.Text; diff --git a/src/Microsoft.AspNetCore.SignalR.Protocols.MessagePack/Protocol/MessagePackHubProtocol.cs b/src/Microsoft.AspNetCore.SignalR.Protocols.MessagePack/Protocol/MessagePackHubProtocol.cs index 0b693605bf..6f6a76252e 100644 --- a/src/Microsoft.AspNetCore.SignalR.Protocols.MessagePack/Protocol/MessagePackHubProtocol.cs +++ b/src/Microsoft.AspNetCore.SignalR.Protocols.MessagePack/Protocol/MessagePackHubProtocol.cs @@ -29,13 +29,17 @@ namespace Microsoft.AspNetCore.SignalR.Protocol private static readonly string ProtocolName = "messagepack"; private static readonly int ProtocolVersion = 1; - + private static readonly int ProtocolMinorVersion = 0; + /// public string Name => ProtocolName; /// public int Version => ProtocolVersion; + /// + public int MinorVersion => ProtocolMinorVersion; + /// public TransferFormat TransferFormat => TransferFormat.Binary; diff --git a/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/VersionJsonHubProtocol.cs b/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/VersionJsonHubProtocol.cs index 86766b088b..8c0e761386 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/VersionJsonHubProtocol.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/VersionJsonHubProtocol.cs @@ -25,6 +25,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests public string Name => _innerProtocol.Name; public int Version => _version; public TransferFormat TransferFormat => _innerProtocol.TransferFormat; + public int MinorVersion => 0; // not used in this test class, just for interface conformance public bool TryParseMessage(ref ReadOnlySequence input, IInvocationBinder binder, out HubMessage message) { diff --git a/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.Protocol.cs b/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.Protocol.cs index 642a897946..a24d6cf3ce 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.Protocol.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.Protocol.cs @@ -63,6 +63,28 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests } } + [Fact] + public async Task ClientIsOkayReceivingMinorVersionInHandshake() + { + // We're just testing that the client doesn't fail when a minor version is added to the handshake + // The client doesn't actually use that version anywhere yet so there's nothing else to test at this time + + var connection = new TestConnection(autoHandshake: false); + var hubConnection = CreateHubConnection(connection); + try + { + var startTask = hubConnection.StartAsync(); + var message = await connection.ReadHandshakeAndSendResponseAsync(56); + + await startTask; + } + finally + { + await hubConnection.DisposeAsync().OrTimeout(); + await connection.DisposeAsync().OrTimeout(); + } + } + [Fact] public async Task InvokeSendsAnInvocationMessage() { diff --git a/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.cs b/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.cs index 4951413baf..c95fd91df8 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.cs @@ -169,6 +169,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests public string Name => "MockHubProtocol"; public int Version => 1; + public int MinorVersion => 1; public TransferFormat TransferFormat => TransferFormat.Binary; diff --git a/test/Microsoft.AspNetCore.SignalR.Client.Tests/TestConnection.cs b/test/Microsoft.AspNetCore.SignalR.Client.Tests/TestConnection.cs index fe979ef5a8..7309fdee70 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.Tests/TestConnection.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.Tests/TestConnection.cs @@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests return this; } - public async Task ReadHandshakeAndSendResponseAsync() + public async Task ReadHandshakeAndSendResponseAsync(int minorVersion = 0) { var s = await ReadSentTextMessageAsync(); @@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests var output = MemoryBufferWriter.Get(); try { - HandshakeProtocol.WriteResponseMessage(HandshakeResponseMessage.Empty, output); + HandshakeProtocol.WriteResponseMessage(new HandshakeResponseMessage(minorVersion), output); response = output.ToArray(); } finally diff --git a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Protocol/HandshakeProtocolTests.cs b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Protocol/HandshakeProtocolTests.cs index c19b88e6c3..d74d6c4a64 100644 --- a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Protocol/HandshakeProtocolTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Protocol/HandshakeProtocolTests.cs @@ -38,6 +38,17 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol Assert.Equal(error, response.Error); } + [Theory] + [InlineData("{\"error\":\"\",\"minorVersion\":34}\u001e", 34)] + [InlineData("{\"error\":\"flump flump flump\",\"minorVersion\":112}\u001e", 112)] + public void ParsingResponseMessageGivesMinorVersion(string json, int version) + { + var message = new ReadOnlySequence(Encoding.UTF8.GetBytes(json)); + + Assert.True(HandshakeProtocol.TryParseResponseMessage(ref message, out var response)); + Assert.Equal(version, response.MinorVersion); + } + [Fact] public void ParsingHandshakeRequestNotCompleteReturnsFalse() { diff --git a/test/Microsoft.AspNetCore.SignalR.Tests.Utils/DummyHubProtocol.cs b/test/Microsoft.AspNetCore.SignalR.Tests.Utils/DummyHubProtocol.cs index 74ca4eaf04..8ce5aa6029 100644 --- a/test/Microsoft.AspNetCore.SignalR.Tests.Utils/DummyHubProtocol.cs +++ b/test/Microsoft.AspNetCore.SignalR.Tests.Utils/DummyHubProtocol.cs @@ -16,6 +16,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests public string Name { get; } public int Version => 1; + public int MinorVersion => 0; public TransferFormat TransferFormat => TransferFormat.Text; public DummyHubProtocol(string name, Action onWrite = null) diff --git a/test/Microsoft.AspNetCore.SignalR.Tests.Utils/TestClient.cs b/test/Microsoft.AspNetCore.SignalR.Tests.Utils/TestClient.cs index 371307737f..c76ef5e892 100644 --- a/test/Microsoft.AspNetCore.SignalR.Tests.Utils/TestClient.cs +++ b/test/Microsoft.AspNetCore.SignalR.Tests.Utils/TestClient.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests private List<(Action handler, object state)> _heartbeatHandlers; private static int _id; - private readonly IHubProtocol _protocol; + private IHubProtocol _protocol; private readonly IInvocationBinder _invocationBinder; private readonly CancellationTokenSource _cts; diff --git a/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTestUtils/Utils.cs b/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTestUtils/Utils.cs index 3e041bd509..294ec7922f 100644 --- a/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTestUtils/Utils.cs +++ b/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTestUtils/Utils.cs @@ -64,9 +64,9 @@ namespace Microsoft.AspNetCore.SignalR.Tests return services.BuildServiceProvider(); } - public static Connections.ConnectionHandler GetHubConnectionHandler(Type hubType) + public static Connections.ConnectionHandler GetHubConnectionHandler(Type hubType, Action addServices = null) { - var serviceProvider = CreateServiceProvider(); + var serviceProvider = CreateServiceProvider(addServices); return (Connections.ConnectionHandler)serviceProvider.GetService(GetConnectionHandlerType(hubType)); } } diff --git a/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTests.cs b/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTests.cs index 3e688fc1f3..26cd439555 100644 --- a/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTests.cs @@ -2332,6 +2332,30 @@ namespace Microsoft.AspNetCore.SignalR.Tests } } + [Fact] + public async Task ServerReportsProtocolMinorVersion() + { + var testProtocol = new Mock(); + testProtocol.Setup(m => m.Name).Returns("CustomProtocol"); + testProtocol.Setup(m => m.MinorVersion).Returns(112); + testProtocol.Setup(m => m.IsVersionSupported(It.IsAny())).Returns(true); + testProtocol.Setup(m => m.TransferFormat).Returns(TransferFormat.Binary); + + var connectionHandler = HubConnectionHandlerTestUtils.GetHubConnectionHandler(typeof(HubT), + (services) => services.AddSingleton(testProtocol.Object)); + + using (var client = new TestClient(protocol: testProtocol.Object)) + { + var connectionHandlerTask = await client.ConnectAsync(connectionHandler); + + Assert.NotNull(client.HandshakeResponseMessage); + Assert.Equal(112, client.HandshakeResponseMessage.MinorVersion); + + client.Dispose(); + await connectionHandlerTask.OrTimeout(); + } + } + private class CustomHubActivator : IHubActivator where THub : Hub { public int ReleaseCount; From 856ac6cb8d8d55be2620d80eee0bf1db8539c4c9 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 5 Jul 2018 13:24:29 -0700 Subject: [PATCH 07/12] AddSignalR tests (#2600) --- .../AddSignalRTests.cs | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 test/Microsoft.AspNetCore.SignalR.Tests/AddSignalRTests.cs diff --git a/test/Microsoft.AspNetCore.SignalR.Tests/AddSignalRTests.cs b/test/Microsoft.AspNetCore.SignalR.Tests/AddSignalRTests.cs new file mode 100644 index 0000000000..6d8360d745 --- /dev/null +++ b/test/Microsoft.AspNetCore.SignalR.Tests/AddSignalRTests.cs @@ -0,0 +1,188 @@ +// Copyright(c) .NET Foundation.All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.SignalR.Protocol; +using Microsoft.Extensions.DependencyInjection; +using Xunit; + +namespace Microsoft.AspNetCore.SignalR.Tests +{ + public class AddSignalRTests + { + [Fact] + public void ServicesAddedBeforeAddSignalRAreUsed() + { + var serviceCollection = new ServiceCollection(); + + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(typeof(HubLifetimeManager<>), typeof(CustomHubLifetimeManager<>)); + serviceCollection.AddSingleton(); + serviceCollection.AddScoped(typeof(IHubActivator<>), typeof(CustomHubActivator<>)); + serviceCollection.AddSingleton(typeof(IHubContext<>), typeof(CustomHubContext<>)); + serviceCollection.AddSingleton(typeof(IHubContext<,>), typeof(CustomHubContext<,>)); + serviceCollection.AddSignalR(); + + var serviceProvider = serviceCollection.BuildServiceProvider(); + Assert.IsType(serviceProvider.GetRequiredService()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType(serviceProvider.GetRequiredService()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + } + + [Fact] + public void ServicesAddedAfterAddSignalRAreUsed() + { + var serviceCollection = new ServiceCollection(); + + serviceCollection.AddSignalR(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(typeof(HubLifetimeManager<>), typeof(CustomHubLifetimeManager<>)); + serviceCollection.AddSingleton(); + serviceCollection.AddScoped(typeof(IHubActivator<>), typeof(CustomHubActivator<>)); + serviceCollection.AddSingleton(typeof(IHubContext<>), typeof(CustomHubContext<>)); + serviceCollection.AddSingleton(typeof(IHubContext<,>), typeof(CustomHubContext<,>)); + + var serviceProvider = serviceCollection.BuildServiceProvider(); + Assert.IsType(serviceProvider.GetRequiredService()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType(serviceProvider.GetRequiredService()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + Assert.IsType>(serviceProvider.GetRequiredService>()); + } + } + + public class CustomHub : Hub + { + } + + public class CustomTHub : Hub + { + } + + public class CustomDynamicHub : DynamicHub + { + } + + public class CustomIdProvider : IUserIdProvider + { + public string GetUserId(HubConnectionContext connection) + { + throw new System.NotImplementedException(); + } + } + + public class CustomHubProtocolResolver : IHubProtocolResolver + { + public IReadOnlyList AllProtocols => throw new System.NotImplementedException(); + + public IHubProtocol GetProtocol(string protocolName, IReadOnlyList supportedProtocols) + { + throw new System.NotImplementedException(); + } + } + + public class CustomHubActivator : IHubActivator where THub : Hub + { + public THub Create() + { + throw new System.NotImplementedException(); + } + + public void Release(THub hub) + { + throw new System.NotImplementedException(); + } + } + + public class CustomHubContext : IHubContext where THub : Hub + { + public IHubClients Clients => throw new System.NotImplementedException(); + + public IGroupManager Groups => throw new System.NotImplementedException(); + } + + public class CustomHubContext : IHubContext + where THub : Hub + where T : class + { + public IHubClients Clients => throw new System.NotImplementedException(); + + public IGroupManager Groups => throw new System.NotImplementedException(); + } + + public class CustomHubLifetimeManager : HubLifetimeManager where THub : Hub + { + public override Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task OnConnectedAsync(HubConnectionContext connection) + { + throw new System.NotImplementedException(); + } + + public override Task OnDisconnectedAsync(HubConnectionContext connection) + { + throw new System.NotImplementedException(); + } + + public override Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendAllAsync(string methodName, object[] args, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendAllExceptAsync(string methodName, object[] args, IReadOnlyList excludedConnectionIds, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendConnectionAsync(string connectionId, string methodName, object[] args, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendConnectionsAsync(IReadOnlyList connectionIds, string methodName, object[] args, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendGroupAsync(string groupName, string methodName, object[] args, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendGroupExceptAsync(string groupName, string methodName, object[] args, IReadOnlyList excludedConnectionIds, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendGroupsAsync(IReadOnlyList groupNames, string methodName, object[] args, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public override Task SendUsersAsync(IReadOnlyList userIds, string methodName, object[] args, CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + } +} From 76afa07c702f77729335f709625942c06ff0b3f0 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 8 Jul 2018 20:10:30 +0000 Subject: [PATCH 08/12] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 100 +++++++++++++++++++-------------------- korebuild-lock.txt | 4 +- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 7583ca3224..19b632d62c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,57 +5,57 @@ 0.10.13 3.1.0 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10000 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10005 1.7.3.4 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 4.6.0-preview1-26617-01 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 - 3.0.0-alpha1-10016 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 + 3.0.0-alpha1-10044 2.2.0-preview1-26618-02 15.6.1 4.7.49 @@ -74,7 +74,7 @@ 2.3.1 2.3.1 2.3.1 - 2.4.0-beta.1.build3945 + 2.4.0-rc.1.build4038 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3f870e51fe..2395ab5956 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:3.0.0-alpha1-10000 -commithash:b7b88d08d55abc8b71de9abf16e26fc713e332cd +version:3.0.0-alpha1-10005 +commithash:05570853de976a526462ca140a55b1ac59d9a351 From f9d37c89b136f6f7a253dba86e94a3fb47549e57 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 15 Jul 2018 20:12:52 +0000 Subject: [PATCH 09/12] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 114 +++++++++++++++++++-------------------- korebuild-lock.txt | 4 +- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 19b632d62c..f9916d6c64 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,72 +5,72 @@ 0.10.13 3.1.0 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10005 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10009 1.7.3.4 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 4.6.0-preview1-26617-01 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 - 3.0.0-alpha1-10044 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 4.6.0-preview1-26708-04 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 + 3.0.0-alpha1-10081 2.2.0-preview1-26618-02 15.6.1 4.7.49 2.0.3 11.0.2 1.2.6 - 4.6.0-preview1-26617-01 - 4.6.0-preview1-26617-01 - 4.6.0-preview1-26617-01 - 4.6.0-preview1-26617-01 + 4.6.0-preview1-26708-04 + 4.6.0-preview1-26708-04 + 4.6.0-preview1-26708-04 + 4.6.0-preview1-26708-04 3.1.1 4.3.0 - 4.6.0-preview1-26617-01 - 4.6.0-preview1-26617-01 - 4.6.0-preview1-26617-01 + 4.6.0-preview1-26708-04 + 4.6.0-preview1-26708-04 + 4.6.0-preview1-26708-04 2.3.1 2.3.1 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 2395ab5956..c6adb40215 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:3.0.0-alpha1-10005 -commithash:05570853de976a526462ca140a55b1ac59d9a351 +version:3.0.0-alpha1-10009 +commithash:86be4707e47d2f1930a982f2b59eacfc4196da33 From 4752d45e0eb78fc39697d5bf987c477a6216e37a Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Wed, 18 Jul 2018 15:47:52 -0700 Subject: [PATCH 10/12] Add the minorVersion field to the HandshakeResponse in the TS client for 3.0 (#2657) --- clients/ts/signalr/src/HandshakeProtocol.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/clients/ts/signalr/src/HandshakeProtocol.ts b/clients/ts/signalr/src/HandshakeProtocol.ts index ba6906ef5f..eebc8fc57e 100644 --- a/clients/ts/signalr/src/HandshakeProtocol.ts +++ b/clients/ts/signalr/src/HandshakeProtocol.ts @@ -10,6 +10,7 @@ export interface HandshakeRequestMessage { export interface HandshakeResponseMessage { readonly error: string; + readonly minorVersion: number; } export class HandshakeProtocol { From e4b96b926f962adcf1a964ff0ba50aebef92cb07 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 22 Jul 2018 13:15:11 -0700 Subject: [PATCH 11/12] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 98 ++++++++++++++++++++-------------------- korebuild-lock.txt | 4 +- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index f9916d6c64..7f1f128e3a 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,57 +5,57 @@ 0.10.13 3.1.0 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10009 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10011 1.7.3.4 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 4.6.0-preview1-26708-04 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 - 3.0.0-alpha1-10081 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 + 3.0.0-alpha1-10123 2.2.0-preview1-26618-02 15.6.1 4.7.49 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index c6adb40215..4cfdfb010e 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:3.0.0-alpha1-10009 -commithash:86be4707e47d2f1930a982f2b59eacfc4196da33 +version:3.0.0-alpha1-10011 +commithash:717c2eb1f91dafd2580c1a9b8e5064d12dd8c054 From b28622e3d2b3fbfef8c86181afe3c6cb0b691e94 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 29 Jul 2018 20:10:52 +0000 Subject: [PATCH 12/12] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 117 ++++++++++++++++++++------------------- korebuild-lock.txt | 4 +- 2 files changed, 61 insertions(+), 60 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 7f1f128e3a..b085209c06 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,76 +5,77 @@ 0.10.13 3.1.0 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10011 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10015 1.7.3.4 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 4.6.0-preview1-26708-04 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 - 3.0.0-alpha1-10123 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 4.6.0-preview1-26727-04 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 + 3.0.0-alpha1-10173 2.2.0-preview1-26618-02 15.6.1 4.7.49 2.0.3 11.0.2 1.2.6 - 4.6.0-preview1-26708-04 - 4.6.0-preview1-26708-04 - 4.6.0-preview1-26708-04 - 4.6.0-preview1-26708-04 + 4.6.0-preview1-26727-04 + 4.6.0-preview1-26727-04 + 4.6.0-preview1-26717-04 + 4.6.0-preview1-26727-04 3.1.1 4.3.0 - 4.6.0-preview1-26708-04 - 4.6.0-preview1-26708-04 - 4.6.0-preview1-26708-04 + 4.6.0-preview1-26727-04 + 4.6.0-preview1-26727-04 + 4.6.0-preview1-26727-04 2.3.1 2.3.1 2.3.1 - 2.4.0-rc.1.build4038 + 2.4.0 + diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 4cfdfb010e..8c70cbad9f 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:3.0.0-alpha1-10011 -commithash:717c2eb1f91dafd2580c1a9b8e5064d12dd8c054 +version:3.0.0-alpha1-10015 +commithash:3f36e5c2f061712f76f2766c435d2555681d5c55