From 0e7c873d62b25a2ace8b79b963cdf161bb9f4c2e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 23 Sep 2019 14:51:25 -0700 Subject: [PATCH 01/15] Avoid null refs in BlazorIgntior when Disposed Fixes https://github.com/aspnet/AspNetCore/issues/14257 --- docs/BuildFromSource.md | 1 + src/Components/Components.sln | 6 +- src/Components/Ignitor/src/BlazorClient.cs | 64 ++----------------- .../Ignitor/src/CancellableOperation.cs | 64 +++++++++++++++++++ .../Web.JS/dist/Release/blazor.server.js | 4 +- src/Shared/E2ETesting/BrowserFixture.cs | 14 ++-- 6 files changed, 84 insertions(+), 69 deletions(-) create mode 100644 src/Components/Ignitor/src/CancellableOperation.cs diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md index 7740ec6140..5cc74a5f9d 100644 --- a/docs/BuildFromSource.md +++ b/docs/BuildFromSource.md @@ -27,6 +27,7 @@ Building ASP.NET Core on Windows requires: ```ps1 PS> ./eng/scripts/InstallJdk.ps1 ``` +* Chrome - Selenium-based tests require a version of Chrome to be installed. Download and install it from [https://www.google.com/chrome] ### macOS/Linux diff --git a/src/Components/Components.sln b/src/Components/Components.sln index 0edcf5e3ca..b95bba6f44 100644 --- a/src/Components/Components.sln +++ b/src/Components/Components.sln @@ -238,6 +238,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.HttpsP EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorServerApp", "Samples\BlazorServerApp\BlazorServerApp.csproj", "{BBF37AF9-8290-4B70-8BA8-0F6017B3B620}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ignitor", "Ignitor", "{29B5A306-7273-4649-8B04-26234D71ADBD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1583,8 +1585,8 @@ Global {DA137BD4-F7F1-4D53-855F-5EC40CEA36B0} = {2FC10057-7A0A-4E34-8302-879925BC0102} {0CDAB70B-71DC-43BE-ACB7-AD2EE3541FFB} = {2FC10057-7A0A-4E34-8302-879925BC0102} {F88118E1-6F4A-4F89-B047-5FFD2889B9F0} = {2FC10057-7A0A-4E34-8302-879925BC0102} - {A78CE874-76B7-46FE-8009-1ED5258BA0AA} = {D6712550-0DA2-49C8-88E1-F04CAB982BF4} - {FC2A1EB0-A116-4689-92B7-239B1DCCF4CA} = {D6712550-0DA2-49C8-88E1-F04CAB982BF4} + {A78CE874-76B7-46FE-8009-1ED5258BA0AA} = {29B5A306-7273-4649-8B04-26234D71ADBD} + {FC2A1EB0-A116-4689-92B7-239B1DCCF4CA} = {29B5A306-7273-4649-8B04-26234D71ADBD} {74D21785-2FAB-4266-B7C4-E311EC8EE0DF} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF} {E4C01A3F-D3C1-4639-A6A9-930E918843DD} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF} {DE297C91-B3E9-4C6F-B74D-0AF9EFEBF684} = {A27FF193-195B-4474-8E6C-840B2E339373} diff --git a/src/Components/Ignitor/src/BlazorClient.cs b/src/Components/Ignitor/src/BlazorClient.cs index 861e2ad0f2..818d41598b 100644 --- a/src/Components/Ignitor/src/BlazorClient.cs +++ b/src/Components/Ignitor/src/BlazorClient.cs @@ -56,7 +56,7 @@ namespace Ignitor private CancellableOperation NextAttachComponentReceived { get; set; } - private CancellableOperation NextBatchReceived { get; set; } + internal CancellableOperation NextBatchReceived { get; set; } private CancellableOperation NextErrorReceived { get; set; } @@ -88,7 +88,7 @@ namespace Ignitor public Task PrepareForNextBatch(TimeSpan? timeout) { - if (NextBatchReceived?.Completion != null) + if (NextBatchReceived != null && !NextBatchReceived.Disposed) { throw new InvalidOperationException("Invalid state previous task not completed"); } @@ -100,7 +100,7 @@ namespace Ignitor public Task PrepareForNextJSInterop(TimeSpan? timeout) { - if (NextJSInteropReceived?.Completion != null) + if (NextJSInteropReceived != null && !NextJSInteropReceived.Disposed) { throw new InvalidOperationException("Invalid state previous task not completed"); } @@ -112,7 +112,7 @@ namespace Ignitor public Task PrepareForNextDotNetInterop(TimeSpan? timeout) { - if (NextDotNetInteropCompletionReceived?.Completion != null) + if (NextDotNetInteropCompletionReceived != null && !NextDotNetInteropCompletionReceived.Disposed) { throw new InvalidOperationException("Invalid state previous task not completed"); } @@ -124,7 +124,7 @@ namespace Ignitor public Task PrepareForNextCircuitError(TimeSpan? timeout) { - if (NextErrorReceived?.Completion != null) + if (NextErrorReceived != null && !NextErrorReceived.Disposed) { throw new InvalidOperationException("Invalid state previous task not completed"); } @@ -136,7 +136,7 @@ namespace Ignitor public Task PrepareForNextDisconnect(TimeSpan? timeout) { - if (NextDisconnect?.Completion != null) + if (NextDisconnect != null && !NextDisconnect.Disposed) { throw new InvalidOperationException("Invalid state previous task not completed"); } @@ -396,7 +396,7 @@ namespace Ignitor NextJSInteropReceived?.Completion?.TrySetResult(null); } - private void OnRenderBatch(int id, byte[] data) + protected virtual void OnRenderBatch(int id, byte[] data) { var capturedBatch = new CapturedRenderBatch(id, data); @@ -499,56 +499,6 @@ namespace Ignitor return element; } - private class CancellableOperation - { - public CancellableOperation(TimeSpan? timeout) - { - Timeout = timeout; - Initialize(); - } - - public TimeSpan? Timeout { get; } - - public TaskCompletionSource Completion { get; set; } - - public CancellationTokenSource Cancellation { get; set; } - - public CancellationTokenRegistration CancellationRegistration { get; set; } - - private void Initialize() - { - Completion = new TaskCompletionSource(TaskContinuationOptions.RunContinuationsAsynchronously); - Completion.Task.ContinueWith( - (task, state) => - { - var operation = (CancellableOperation)state; - operation.Dispose(); - }, - this, - TaskContinuationOptions.ExecuteSynchronously); // We need to execute synchronously to clean-up before anything else continues - if (Timeout != null && Timeout != System.Threading.Timeout.InfiniteTimeSpan && Timeout != TimeSpan.MaxValue) - { - Cancellation = new CancellationTokenSource(Timeout.Value); - CancellationRegistration = Cancellation.Token.Register( - (self) => - { - var operation = (CancellableOperation)self; - operation.Completion.TrySetCanceled(operation.Cancellation.Token); - operation.Cancellation.Dispose(); - operation.CancellationRegistration.Dispose(); - }, - this); - } - } - - private void Dispose() - { - Completion = null; - Cancellation.Dispose(); - CancellationRegistration.Dispose(); - } - } - private string[] ReadMarkers(string content) { content = content.Replace("\r\n", "").Replace("\n", ""); diff --git a/src/Components/Ignitor/src/CancellableOperation.cs b/src/Components/Ignitor/src/CancellableOperation.cs new file mode 100644 index 0000000000..dad8cb5587 --- /dev/null +++ b/src/Components/Ignitor/src/CancellableOperation.cs @@ -0,0 +1,64 @@ +// 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; +using System.Threading; +using System.Threading.Tasks; + +namespace Ignitor +{ + internal class CancellableOperation + { + public CancellableOperation(TimeSpan? timeout) + { + Timeout = timeout; + + Completion = new TaskCompletionSource(TaskContinuationOptions.RunContinuationsAsynchronously); + Completion.Task.ContinueWith( + (task, state) => + { + var operation = (CancellableOperation)state; + operation.Dispose(); + }, + this, + TaskContinuationOptions.ExecuteSynchronously); // We need to execute synchronously to clean-up before anything else continues + + if (Timeout != null && Timeout != System.Threading.Timeout.InfiniteTimeSpan && Timeout != TimeSpan.MaxValue) + { + Cancellation = new CancellationTokenSource(Timeout.Value); + CancellationRegistration = Cancellation.Token.Register( + (self) => + { + var operation = (CancellableOperation)self; + operation.Completion.TrySetCanceled(operation.Cancellation.Token); + operation.Cancellation.Dispose(); + operation.CancellationRegistration.Dispose(); + }, + this); + } + } + + public TimeSpan? Timeout { get; } + + public TaskCompletionSource Completion { get; } + + public CancellationTokenSource Cancellation { get; } + + public CancellationTokenRegistration CancellationRegistration { get; } + + public bool Disposed { get; private set; } + + private void Dispose() + { + if (Disposed) + { + return; + } + + Disposed = true; + Completion.TrySetCanceled(Cancellation.Token); + Cancellation.Dispose(); + CancellationRegistration.Dispose(); + } + } +} diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index 230514a51c..aec8945b29 100644 --- a/src/Components/Web.JS/dist/Release/blazor.server.js +++ b/src/Components/Web.JS/dist/Release/blazor.server.js @@ -1,4 +1,4 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=49)}([function(e,t,n){"use strict";var r;n.d(t,"a",function(){return r}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"h",function(){return f}),n.d(t,"e",function(){return h}),n.d(t,"d",function(){return p}),n.d(t,"b",function(){return d});var r=n(0),o=n(7),i=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},s=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch(function(e){})},e}(),d=function(){function e(e){this.minimumLogLevel=e,this.outputConsole=console}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.a.Critical:case r.a.Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+r.a[e]+": "+t)}},e}()},function(e,t,n){"use strict";n.r(t);var r,o,i=n(3),s=n(4),a=n(43),c=n(0),u=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=function(e){function t(t){var n=e.call(this)||this;return n.logger=t,n}return u(t,e),t.prototype.send=function(e){var t=this;return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var a=e.headers;a&&Object.keys(a).forEach(function(e){o.setRequestHeader(e,a[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=function(){o.abort(),r(new i.a)}),e.timeout&&(o.timeout=e.timeout),o.onload=function(){e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new s.b(o.status,o.statusText,o.response||o.responseText)):r(new i.b(o.statusText,o.status))},o.onerror=function(){t.logger.log(c.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new i.b(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(c.a.Warning,"Timeout from HTTP request."),r(new i.c)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(s.a),f=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h=function(e){function t(t){var n=e.call(this)||this;return"undefined"!=typeof XMLHttpRequest?n.httpClient=new l(t):n.httpClient=new a.a(t),n}return f(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},t}(s.a),p=n(44);!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(o||(o={}));var d,g=n(1),y=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+i.join(" ")))]:[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})},e.prototype.constructTransport=function(e){switch(e){case E.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new A(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket);case E.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new D(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource);case E.LongPolling:return new P(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1);default:throw new Error("Unknown transport: "+e+".")}},e.prototype.startTransport=function(e,t){var n=this;return this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return n.stopConnection(e)},this.transport.connect(e,t)},e.prototype.resolveTransportOrError=function(e,t,n){var r=E[e.transport];if(null==r)return this.logger.log(c.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),new Error("Skipping transport '"+e.transport+"' because it is not supported by this client.");if(!function(e,t){return!e||0!=(t&e)}(t,r))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it was disabled by the client."),new Error("'"+E[r]+"' is disabled by the client.");if(!(e.transferFormats.map(function(e){return S[e]}).indexOf(n)>=0))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it does not support the requested transfer format '"+S[n]+"'."),new Error("'"+E[r]+"' does not support "+S[n]+".");if(r===E.WebSockets&&!this.options.WebSocket||r===E.ServerSentEvents&&!this.options.EventSource)return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it is not supported in your environment.'"),new Error("'"+E[r]+"' is not supported in your environment.");this.logger.log(c.a.Debug,"Selecting transport '"+E[r]+"'.");try{return this.constructTransport(r)}catch(e){return e}},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){if(this.logger.log(c.a.Debug,"HttpConnection.stopConnection("+e+") called while in state "+this.connectionState+"."),this.transport=void 0,e=this.stopError||e,this.stopError=void 0,"Disconnected"!==this.connectionState)if("Connecting "!==this.connectionState){if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(c.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(c.a.Information,"Connection disconnected."),this.connectionId=void 0,this.connectionState="Disconnected",this.onclose&&this.connectionStarted){this.connectionStarted=!1;try{this.onclose(e)}catch(t){this.logger.log(c.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(c.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection hasn't yet left the in the connecting state.");else this.logger.log(c.a.Debug,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is already in the disconnected state.")},e.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!g.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(c.a.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},e.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t)},e}();var q=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new W,this.transportResult=new W,this.sendLoopPromise=this.sendLoop()}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult||(this.transportResult=new W),this.transportResult.promise},e.prototype.stop=function(){return this.executing=!1,this.sendBufferedData.resolve(),this.sendLoopPromise},e.prototype.bufferData=function(e){if(this.buffer.length&&typeof this.buffer[0]!=typeof e)throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof e);this.buffer.push(e),this.sendBufferedData.resolve()},e.prototype.sendLoop=function(){return B(this,void 0,void 0,function(){var t,n,r;return j(this,function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return this.transportResult&&this.transportResult.reject("Connection stopped."),[3,6];this.sendBufferedData=new W,t=this.transportResult,this.transportResult=void 0,n="string"==typeof this.buffer[0]?this.buffer.join(""):e.concatBuffers(this.buffer),this.buffer.length=0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.transport.send(n)];case 3:return o.sent(),t.resolve(),[3,5];case 4:return r=o.sent(),t.reject(r),[3,5];case 5:return[3,0];case 6:return[2]}})})},e.concatBuffers=function(e){for(var t=e.map(function(e){return e.byteLength}).reduce(function(e,t){return e+t}),n=new Uint8Array(t),r=0,o=0,i=e;o0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch(function(e){})},e}(),d=function(){function e(e){this.minimumLogLevel=e,this.outputConsole=console}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.a.Critical:case r.a.Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+r.a[e]+": "+t)}},e}()},function(e,t,n){"use strict";n.r(t);var r,o,i=n(3),s=n(4),a=n(43),c=n(0),u=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=function(e){function t(t){var n=e.call(this)||this;return n.logger=t,n}return u(t,e),t.prototype.send=function(e){var t=this;return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var a=e.headers;a&&Object.keys(a).forEach(function(e){o.setRequestHeader(e,a[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=function(){o.abort(),r(new i.a)}),e.timeout&&(o.timeout=e.timeout),o.onload=function(){e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new s.b(o.status,o.statusText,o.response||o.responseText)):r(new i.b(o.statusText,o.status))},o.onerror=function(){t.logger.log(c.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new i.b(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(c.a.Warning,"Timeout from HTTP request."),r(new i.c)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(s.a),f=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h=function(e){function t(t){var n=e.call(this)||this;return"undefined"!=typeof XMLHttpRequest?n.httpClient=new l(t):n.httpClient=new a.a(t),n}return f(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},t}(s.a),p=n(44);!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(o||(o={}));var d,g=n(1),y=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+i.join(" ")))]:[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})},e.prototype.constructTransport=function(e){switch(e){case E.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new A(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket);case E.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new D(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource);case E.LongPolling:return new P(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1);default:throw new Error("Unknown transport: "+e+".")}},e.prototype.startTransport=function(e,t){var n=this;return this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return n.stopConnection(e)},this.transport.connect(e,t)},e.prototype.resolveTransportOrError=function(e,t,n){var r=E[e.transport];if(null==r)return this.logger.log(c.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),new Error("Skipping transport '"+e.transport+"' because it is not supported by this client.");if(!function(e,t){return!e||0!=(t&e)}(t,r))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it was disabled by the client."),new Error("'"+E[r]+"' is disabled by the client.");if(!(e.transferFormats.map(function(e){return S[e]}).indexOf(n)>=0))return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it does not support the requested transfer format '"+S[n]+"'."),new Error("'"+E[r]+"' does not support "+S[n]+".");if(r===E.WebSockets&&!this.options.WebSocket||r===E.ServerSentEvents&&!this.options.EventSource)return this.logger.log(c.a.Debug,"Skipping transport '"+E[r]+"' because it is not supported in your environment.'"),new Error("'"+E[r]+"' is not supported in your environment.");this.logger.log(c.a.Debug,"Selecting transport '"+E[r]+"'.");try{return this.constructTransport(r)}catch(e){return e}},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){if(this.logger.log(c.a.Debug,"HttpConnection.stopConnection("+e+") called while in state "+this.connectionState+"."),this.transport=void 0,e=this.stopError||e,this.stopError=void 0,"Disconnected"!==this.connectionState)if("Connecting "!==this.connectionState){if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(c.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(c.a.Information,"Connection disconnected."),this.connectionId=void 0,this.connectionState="Disconnected",this.onclose&&this.connectionStarted){this.connectionStarted=!1;try{this.onclose(e)}catch(t){this.logger.log(c.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(c.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection hasn't yet left the in the connecting state.");else this.logger.log(c.a.Debug,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is already in the disconnected state.")},e.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!g.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(c.a.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},e.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t)},e}();var q=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new W,this.transportResult=new W,this.sendLoopPromise=this.sendLoop()}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult||(this.transportResult=new W),this.transportResult.promise},e.prototype.stop=function(){return this.executing=!1,this.sendBufferedData.resolve(),this.sendLoopPromise},e.prototype.bufferData=function(e){if(this.buffer.length&&typeof this.buffer[0]!=typeof e)throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof e);this.buffer.push(e),this.sendBufferedData.resolve()},e.prototype.sendLoop=function(){return B(this,void 0,void 0,function(){var t,n,r;return j(this,function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return this.transportResult&&this.transportResult.reject("Connection stopped."),[3,6];this.sendBufferedData=new W,t=this.transportResult,this.transportResult=void 0,n="string"==typeof this.buffer[0]?this.buffer.join(""):e.concatBuffers(this.buffer),this.buffer.length=0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.transport.send(n)];case 3:return o.sent(),t.resolve(),[3,5];case 4:return r=o.sent(),t.reject(r),[3,5];case 5:return[3,0];case 6:return[2]}})})},e.concatBuffers=function(e){for(var t=e.map(function(e){return e.byteLength}).reduce(function(e,t){return e+t}),n=new Uint8Array(t),r=0,o=0,i=e;o * @license MIT */ -function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(c=l[u],!b(e[c],t[c],n,r))return!1;return!0}(e,t,n,s))}return n?e===t:e==t}function m(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&y(o,n,"Missing expected exception"+r);var s="string"==typeof r,a=!e&&o&&!n;if((!e&&i.isError(o)&&s&&w(o,n)||a)&&y(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g((t=this).actual),128)+" "+t.operator+" "+d(g(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=p(n),s=o.indexOf("\n"+i);if(s>=0){var a=o.indexOf("\n",s+1);o=o.substring(a+1)}this.stack=o}}},i.inherits(f.AssertionError,Error),f.fail=y,f.ok=v,f.equal=function(e,t,n){e!=t&&y(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&y(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){b(e,t,!1)||y(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){b(e,t,!0)||y(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){b(e,t,!1)&&y(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&y(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&y(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&y(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){E(!0,e,t,n)},f.doesNotThrow=function(e,t,n){E(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(10))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){e.exports=n(11)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t,n){"use strict";var r=n(14).Buffer,o=n(60);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,n=i,o=a,t.copy(n,o),a+=s.data.length,s=s.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){var r=n(6),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s),i(o,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(63),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(10))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,s,a,c=1,u={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&d(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=a},function(e,t,n){(t=e.exports=n(36)).Stream=t,t.Readable=t,t.Writable=n(41),t.Duplex=n(11),t.Transform=n(42),t.PassThrough=n(67)},function(e,t,n){"use strict";e.exports=i;var r=n(42),o=n(20);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(15),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(22);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(35).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,f,h=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t=0;f--)p+=e.readUInt8(r+f+1)*Math.pow(2,8*(7-f));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var s=e.readUInt32BE(t+0),a=e.readUInt32BE(t+4);return(4294967296*s+a)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),s(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),s(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),a(e,r,i,3);case 223:throw new Error("map too big to decode in JS");case 212:return c(e,r,1);case 213:return c(e,r,2);case 214:return c(e,r,4);case 215:return c(e,r,8);case 216:return c(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?u(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?u(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?u(e,r,l,i,6):null}if(144==(240&h))return s(e,r,i=15&h,1);if(128==(240&h))return a(e,r,i=15&h,1);if(160==(224&h))return t(i=31&h,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(h>=224)return n(p=h-256,1);if(h<128)return n(h,1);throw new Error("not implemented yet")}function s(e,t,r,o){var s,a=[],c=0;for(t+=o,s=0;si)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,i){function a(c,u){var l,f,h;if(void 0===c)throw new Error("undefined is not encodable in msgpack!");if(null===c)(l=r.allocUnsafe(1))[0]=192;else if(!0===c)(l=r.allocUnsafe(1))[0]=195;else if(!1===c)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof c)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,1),l.write(c,5));else if(c&&(c.readUInt32LE||c instanceof Uint8Array))c instanceof Uint8Array&&(c=r.from(c)),c.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=c.length):c.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(c.length,1)),l=o([l,c]);else if(Array.isArray(c))c.length<16?(l=r.allocUnsafe(1))[0]=144|c.length:c.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(c.length,1)),l=c.reduce(function(e,t){return e.append(a(t,!0)),e},o().append(l));else{if(!i&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),s=1e6*(n-1e3*i);if(s||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var a=4*s,c=i/Math.pow(2,32),u=a+c&4294967295,l=4294967295&i;t.writeInt32BE(u,2),t.writeInt32BE(l,6)}else(t=new r(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(c);if("object"==typeof c)l=function(t){var n,i,s=-1,a=[];for(n=0;n>8),a.push(255&s)):(a.push(201),a.push(s>>24),a.push(s>>16&255),a.push(s>>8&255),a.push(255&s));return o().append(r.from(a)).append(i)}(c)||function(e){var t,n,i=[],s=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++s,i.push(a(t,!0)),i.push(a(e[t],!0)));s<16?(n=r.allocUnsafe(1))[0]=128|s:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(s,1));return i.unshift(n),i.reduce(function(e,t){return e.append(t)},o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return s(c,t);if(c>=0)if(c<128)(l=r.allocUnsafe(1))[0]=c;else if(c<256)(l=r.allocUnsafe(2))[0]=204,l[1]=c;else if(c<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(c,1);else if(c<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(c,1);else{if(!(c<=9007199254740991))return s(c,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,c)}else if(c>=-32)(l=r.allocUnsafe(1))[0]=256+c;else if(c>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(c,1);else if(c>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(c,1);else if(c>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(c,1);else{if(!(c>=-9007199254740991))return s(c,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var s=1,a=t+7;a>=t;a--){var c=(255^e[a])+s;e[a]=255&c,s=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return a}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]this.nextBatchId?this.fatalError?(this.logger.log(a.LogLevel.Debug,"Received a new batch "+e+" but errored out on a previous batch "+(this.nextBatchId-1)),[4,n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())]):[3,4]:[3,5];case 3:return o.sent(),[2];case 4:return this.logger.log(a.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed."),[2];case 5:return o.trys.push([5,7,,8]),this.nextBatchId++,this.logger.log(a.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new s.OutOfProcessRenderBatch(t)),[4,this.completeBatch(n,e)];case 6:return o.sent(),[3,8];case 7:throw r=o.sent(),this.fatalError=r.toString(),this.logger.log(a.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,r.toString()),r;case 8:return[2]}})})},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(a.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}})})},e}();t.RenderQueue=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(72),o=Math.pow(2,32),i=Math.pow(2,21)-1,s=function(){function e(e){this.batchData=e;var t=new l(e);this.arrayRangeReader=new f(e),this.arrayBuilderSegmentReader=new h(e),this.diffReader=new a(e),this.editReader=new c(e,t),this.frameReader=new u(e,t)}return e.prototype.updatedComponents=function(){return p(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return p(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return p(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return p(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return p(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+20*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return p(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+8*t;return g(this.batchData,n)},e}();t.OutOfProcessRenderBatch=s;var a=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return p(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),c=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return p(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return p(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return p(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return p(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=p(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),u=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return p(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return p(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return p(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=p(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=p(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return g(this.batchDataUint8,e+12)},e}(),l=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=p(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t,n=p(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<>>0)}function g(e,t){var n=d(e,t+4);if(n>i)throw new Error("Cannot read uint64 with high order part "+n+", because the result would exceed Number.MAX_SAFE_INTEGER.");return n*o+d(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof TextDecoder?new TextDecoder("utf-8"):null;t.decodeUtf8=r?r.decode.bind(r):function(e){var t=0,n=e.length,r=[],o=[];for(;t65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16),o=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}();t.NullLogger=o;var i=function(){function e(e){this.minimumLogLevel=e}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},e.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},e}();t.DefaultReconnectDisplay=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.dialog=e}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.rejected=function(){this.removeClasses(),this.dialog.classList.add(e.RejectedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName,e.RejectedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e.RejectedClassName="components-reconnect-rejected",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";n.r(t);var r=n(6),o=n(12),i=n(2),s=function(){function e(){}return e.write=function(e){var t=e.byteLength||e.length,n=[];do{var r=127&t;(t>>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+s))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+s):n.subarray(o+i,o+i+s)),o=o+i+s}return t},e}();var a=new Uint8Array([145,i.MessageType.Ping]),c=function(){function e(){this.name="messagepack",this.version=1,this.transferFormat=i.TransferFormat.Binary,this.errorResult=1,this.voidResult=2,this.nonVoidResult=3}return e.prototype.parseMessages=function(e,t){if(!(e instanceof r.Buffer||(n=e,n&&"undefined"!=typeof ArrayBuffer&&(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer or Buffer.");var n;null===t&&(t=i.NullLogger.instance);for(var o=[],a=0,c=s.parse(e);a=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(c=l[u],!b(e[c],t[c],n,r))return!1;return!0}(e,t,n,s))}return n?e===t:e==t}function m(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&y(o,n,"Missing expected exception"+r);var s="string"==typeof r,a=!e&&o&&!n;if((!e&&i.isError(o)&&s&&w(o,n)||a)&&y(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g((t=this).actual),128)+" "+t.operator+" "+d(g(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=p(n),s=o.indexOf("\n"+i);if(s>=0){var a=o.indexOf("\n",s+1);o=o.substring(a+1)}this.stack=o}}},i.inherits(f.AssertionError,Error),f.fail=y,f.ok=v,f.equal=function(e,t,n){e!=t&&y(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&y(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){b(e,t,!1)||y(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){b(e,t,!0)||y(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){b(e,t,!1)&&y(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&y(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&y(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&y(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){E(!0,e,t,n)},f.doesNotThrow=function(e,t,n){E(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(10))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){e.exports=n(11)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t,n){"use strict";var r=n(14).Buffer,o=n(60);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,n=i,o=a,t.copy(n,o),a+=s.data.length,s=s.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){var r=n(6),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s),i(o,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(63),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(10))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,s,a,c=1,u={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&d(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=a},function(e,t,n){(t=e.exports=n(36)).Stream=t,t.Readable=t,t.Writable=n(41),t.Duplex=n(11),t.Transform=n(42),t.PassThrough=n(67)},function(e,t,n){"use strict";e.exports=i;var r=n(42),o=n(20);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(15),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(22);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(35).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,f,h=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t=0;f--)p+=e.readUInt8(r+f+1)*Math.pow(2,8*(7-f));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var s=e.readUInt32BE(t+0),a=e.readUInt32BE(t+4);return(4294967296*s+a)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),s(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),s(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),a(e,r,i,3);case 223:throw new Error("map too big to decode in JS");case 212:return c(e,r,1);case 213:return c(e,r,2);case 214:return c(e,r,4);case 215:return c(e,r,8);case 216:return c(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?u(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?u(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?u(e,r,l,i,6):null}if(144==(240&h))return s(e,r,i=15&h,1);if(128==(240&h))return a(e,r,i=15&h,1);if(160==(224&h))return t(i=31&h,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(h>=224)return n(p=h-256,1);if(h<128)return n(h,1);throw new Error("not implemented yet")}function s(e,t,r,o){var s,a=[],c=0;for(t+=o,s=0;si)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,i){function a(c,u){var l,f,h;if(void 0===c)throw new Error("undefined is not encodable in msgpack!");if(null===c)(l=r.allocUnsafe(1))[0]=192;else if(!0===c)(l=r.allocUnsafe(1))[0]=195;else if(!1===c)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof c)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,1),l.write(c,5));else if(c&&(c.readUInt32LE||c instanceof Uint8Array))c instanceof Uint8Array&&(c=r.from(c)),c.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=c.length):c.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(c.length,1)),l=o([l,c]);else if(Array.isArray(c))c.length<16?(l=r.allocUnsafe(1))[0]=144|c.length:c.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(c.length,1)),l=c.reduce(function(e,t){return e.append(a(t,!0)),e},o().append(l));else{if(!i&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),s=1e6*(n-1e3*i);if(s||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var a=4*s,c=i/Math.pow(2,32),u=a+c&4294967295,l=4294967295&i;t.writeInt32BE(u,2),t.writeInt32BE(l,6)}else(t=new r(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(c);if("object"==typeof c)l=function(t){var n,i,s=-1,a=[];for(n=0;n>8),a.push(255&s)):(a.push(201),a.push(s>>24),a.push(s>>16&255),a.push(s>>8&255),a.push(255&s));return o().append(r.from(a)).append(i)}(c)||function(e){var t,n,i=[],s=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++s,i.push(a(t,!0)),i.push(a(e[t],!0)));s<16?(n=r.allocUnsafe(1))[0]=128|s:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(s,1));return i.unshift(n),i.reduce(function(e,t){return e.append(t)},o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return s(c,t);if(c>=0)if(c<128)(l=r.allocUnsafe(1))[0]=c;else if(c<256)(l=r.allocUnsafe(2))[0]=204,l[1]=c;else if(c<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(c,1);else if(c<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(c,1);else{if(!(c<=9007199254740991))return s(c,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,c)}else if(c>=-32)(l=r.allocUnsafe(1))[0]=256+c;else if(c>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(c,1);else if(c>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(c,1);else if(c>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(c,1);else{if(!(c>=-9007199254740991))return s(c,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var s=1,a=t+7;a>=t;a--){var c=(255^e[a])+s;e[a]=255&c,s=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return a}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]this.nextBatchId?this.fatalError?(this.logger.log(a.LogLevel.Debug,"Received a new batch "+e+" but errored out on a previous batch "+(this.nextBatchId-1)),[4,n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())]):[3,4]:[3,5];case 3:return o.sent(),[2];case 4:return this.logger.log(a.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed."),[2];case 5:return o.trys.push([5,7,,8]),this.nextBatchId++,this.logger.log(a.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new s.OutOfProcessRenderBatch(t)),[4,this.completeBatch(n,e)];case 6:return o.sent(),[3,8];case 7:throw r=o.sent(),this.fatalError=r.toString(),this.logger.log(a.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,r.toString()),r;case 8:return[2]}})})},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(a.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}})})},e}();t.RenderQueue=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(72),o=Math.pow(2,32),i=Math.pow(2,21)-1,s=function(){function e(e){this.batchData=e;var t=new l(e);this.arrayRangeReader=new f(e),this.arrayBuilderSegmentReader=new h(e),this.diffReader=new a(e),this.editReader=new c(e,t),this.frameReader=new u(e,t)}return e.prototype.updatedComponents=function(){return p(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return p(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return p(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return p(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return p(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+20*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return p(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+8*t;return g(this.batchData,n)},e}();t.OutOfProcessRenderBatch=s;var a=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return p(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),c=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return p(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return p(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return p(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return p(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=p(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),u=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return p(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return p(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return p(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=p(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=p(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=p(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return g(this.batchDataUint8,e+12)},e}(),l=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=p(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t,n=p(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<>>0)}function g(e,t){var n=d(e,t+4);if(n>i)throw new Error("Cannot read uint64 with high order part "+n+", because the result would exceed Number.MAX_SAFE_INTEGER.");return n*o+d(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof TextDecoder?new TextDecoder("utf-8"):null;t.decodeUtf8=r?r.decode.bind(r):function(e){var t=0,n=e.length,r=[],o=[];for(;t65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16),o=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}();t.NullLogger=o;var i=function(){function e(e){this.minimumLogLevel=e}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},e.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},e}();t.DefaultReconnectDisplay=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.dialog=e}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.rejected=function(){this.removeClasses(),this.dialog.classList.add(e.RejectedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName,e.RejectedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e.RejectedClassName="components-reconnect-rejected",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";n.r(t);var r=n(6),o=n(12),i=n(2),s=function(){function e(){}return e.write=function(e){var t=e.byteLength||e.length,n=[];do{var r=127&t;(t>>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+s))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+s):n.subarray(o+i,o+i+s)),o=o+i+s}return t},e}();var a=new Uint8Array([145,i.MessageType.Ping]),c=function(){function e(){this.name="messagepack",this.version=1,this.transferFormat=i.TransferFormat.Binary,this.errorResult=1,this.voidResult=2,this.nonVoidResult=3}return e.prototype.parseMessages=function(e,t){if(!(e instanceof r.Buffer||(n=e,n&&"undefined"!=typeof ArrayBuffer&&(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer or Buffer.");var n;null===t&&(t=i.NullLogger.instance);for(var o=[],a=0,c=s.parse(e);a= maxAttempts) - { - throw new InvalidOperationException("Couldn't create a Selenium remote driver client. The server is irresponsive"); - } + output.WriteLine($"Error initializing RemoteWebDriver: {ex.Message}"); } + attempt++; + } while (attempt < maxAttempts); - // We will never get here. Keeping the compiler happy. - throw new InvalidOperationException("Couldn't create a Selenium remote driver client. The server is unresponsive"); + throw new InvalidOperationException("Couldn't create a Selenium remote driver client. The server is irresponsive"); } } } From c90690233380937c000c08869adbc8be3596737e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 23 Sep 2019 20:48:42 -0700 Subject: [PATCH 02/15] Apply suggestions from code review --- src/Components/Ignitor/src/BlazorClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Ignitor/src/BlazorClient.cs b/src/Components/Ignitor/src/BlazorClient.cs index 818d41598b..df93faa3b3 100644 --- a/src/Components/Ignitor/src/BlazorClient.cs +++ b/src/Components/Ignitor/src/BlazorClient.cs @@ -56,7 +56,7 @@ namespace Ignitor private CancellableOperation NextAttachComponentReceived { get; set; } - internal CancellableOperation NextBatchReceived { get; set; } + private CancellableOperation NextBatchReceived { get; set; } private CancellableOperation NextErrorReceived { get; set; } @@ -396,7 +396,7 @@ namespace Ignitor NextJSInteropReceived?.Completion?.TrySetResult(null); } - protected virtual void OnRenderBatch(int id, byte[] data) + private void OnRenderBatch(int id, byte[] data) { var capturedBatch = new CapturedRenderBatch(id, data); From 731293d6da534ad2bdf1c7d0da34676e782c60a7 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sun, 22 Sep 2019 21:52:03 -0700 Subject: [PATCH 03/15] Update branding to 2.2.8 - aspnet/AspNetCore-Internal#3153 --- eng/Baseline.Designer.props | 21 ++++++++++--------- eng/Baseline.xml | 12 +++++------ eng/PatchConfig.props | 8 +++---- .../ArchiveBaseline.2.2.7.txt | 1 + .../ArchiveBaseline.2.2.7.txt | 1 + version.props | 2 +- 6 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt create mode 100644 src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 02e35937c3..c1c2064ac6 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,7 +2,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.2.6 + 2.2.7 @@ -77,12 +77,12 @@ - 2.2.6 + 2.2.7 - 2.2.6 + 2.2.7 @@ -303,10 +303,11 @@ - 2.2.0 + 2.2.7 + @@ -434,21 +435,21 @@ - 2.2.0 + 2.2.7 - - + + - + @@ -1219,12 +1220,12 @@ - 2.2.0 + 2.2.7 - + diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 4edbdbadf4..aa835ca203 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,7 +4,7 @@ This file contains a list of all the packages and their versions which were rele build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. --> - + @@ -12,8 +12,8 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - - + + @@ -39,7 +39,7 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - + @@ -53,7 +53,7 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - + @@ -124,7 +124,7 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - + diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 3f12fb1a02..36217a524c 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -39,10 +39,6 @@ Later on, this will be checked using this condition: java:signalr; - - - - @aspnet/signalr; @@ -80,4 +76,8 @@ Later on, this will be checked using this condition: Microsoft.AspNetCore.SpaServices; + + + + diff --git a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt @@ -0,0 +1 @@ + diff --git a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt @@ -0,0 +1 @@ + diff --git a/version.props b/version.props index 6dd444f335..2e9e0020d1 100644 --- a/version.props +++ b/version.props @@ -2,7 +2,7 @@ 2 2 - 7 + 8 servicing $([System.DateTime]::Now.ToString('yyMMdd'))-99 From 2597a3be2d83563cf06f5b1e0ce9ca9d0b1743f6 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Tue, 24 Sep 2019 18:43:54 -0700 Subject: [PATCH 04/15] Remove package archive file 1/2 --- .../Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt diff --git a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt deleted file mode 100644 index 8b13789179..0000000000 --- a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.7.txt +++ /dev/null @@ -1 +0,0 @@ - From a925230597f48f3d845f80eebcf5c875d1537da4 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Tue, 24 Sep 2019 18:44:13 -0700 Subject: [PATCH 05/15] Remove package archive file 2/2 --- .../Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt diff --git a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt deleted file mode 100644 index 8b13789179..0000000000 --- a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.7.txt +++ /dev/null @@ -1 +0,0 @@ - From 6317b34aaa798a36ff905fca77f436f875d50612 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 25 Sep 2019 13:35:14 -0700 Subject: [PATCH 06/15] Increase httpclient reliability (#14349) --- .../src/Commands/BaseCommand.cs | 57 ++++++++++++++++++- .../test/OpenApiAddURLTests.cs | 4 +- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/Tools/Microsoft.dotnet-openapi/src/Commands/BaseCommand.cs b/src/Tools/Microsoft.dotnet-openapi/src/Commands/BaseCommand.cs index 7123f0d04e..92fe39df4f 100644 --- a/src/Tools/Microsoft.dotnet-openapi/src/Commands/BaseCommand.cs +++ b/src/Tools/Microsoft.dotnet-openapi/src/Commands/BaseCommand.cs @@ -6,9 +6,12 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; +using System.Net; +using System.Net.Http; using System.Reflection; using System.Security.Cryptography; using System.Text.Json; +using System.Threading; using System.Threading.Tasks; using Microsoft.Build.Evaluation; using Microsoft.DotNet.Openapi.Tools; @@ -240,13 +243,13 @@ namespace Microsoft.DotNet.OpenApi.Commands internal async Task DownloadToFileAsync(string url, string destinationPath, bool overwrite) { - using var response = await _httpClient.GetResponseAsync(url); + using var response = await RetryRequest(() => _httpClient.GetResponseAsync(url)); await WriteToFileAsync(await response.Stream, destinationPath, overwrite); } internal async Task DownloadGivenOption(string url, CommandOption fileOption) { - using var response = await _httpClient.GetResponseAsync(url); + using var response = await RetryRequest(() => _httpClient.GetResponseAsync(url)); if (response.IsSuccessCode()) { @@ -272,6 +275,56 @@ namespace Microsoft.DotNet.OpenApi.Commands } } + /// + /// Retries every 1 sec for 60 times by default. + /// + /// + /// + /// + /// + private static async Task RetryRequest( + Func> retryBlock, + CancellationToken cancellationToken = default, + int retryCount = 60) + { + for (var retry = 0; retry < retryCount; retry++) + { + if (cancellationToken.IsCancellationRequested) + { + throw new OperationCanceledException("Failed to connect, retry canceled.", cancellationToken); + } + + try + { + var response = await retryBlock().ConfigureAwait(false); + + if (response.StatusCode == HttpStatusCode.ServiceUnavailable) + { + // Automatically retry on 503. May be application is still booting. + continue; + } + + return response; // Went through successfully + } + catch (Exception exception) + { + if (retry == retryCount - 1) + { + throw; + } + else + { + if (exception is HttpRequestException || exception is WebException) + { + await Task.Delay(1 * 1000); //Wait for a while before retry. + } + } + } + } + + throw new OperationCanceledException("Failed to connect, retry limit exceeded."); + } + private string GetUniqueFileName(string directory, string fileName, string extension) { var uniqueName = fileName; diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs index 95369d7683..ff8000263d 100644 --- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs +++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs @@ -440,8 +440,8 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests var url = BrokenUrl; var run = app.Execute(new[] { "add", "url", url }); - Assert.Equal(_error.ToString(), $"The given url returned 'NotFound', " + - "indicating failure. The url might be wrong, or there might be a networking issue."+Environment.NewLine); + Assert.Equal($"The given url returned 'NotFound', " + + "indicating failure. The url might be wrong, or there might be a networking issue."+Environment.NewLine, _error.ToString()); Assert.Equal(1, run); var expectedJsonName = "dingos.json"; From 24fc9c0008653811785d3c647cfa1b6e6abb6d2f Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Wed, 28 Aug 2019 09:03:49 -0700 Subject: [PATCH 07/15] Add tests of `MetadataSerializer` - #4914 (2 of probably 3 or 4) nit: Use more `var` --- .../test/GetCurrentOpenApiReferenceTest.cs | 6 +- .../test/GetOpenApiReferenceMetadataTest.cs | 18 +- .../test/MetadataSerializerTest.cs | 314 ++++++++++++++++++ 3 files changed, 326 insertions(+), 12 deletions(-) create mode 100644 src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs diff --git a/src/Tools/Extensions.ApiDescription.Client/test/GetCurrentOpenApiReferenceTest.cs b/src/Tools/Extensions.ApiDescription.Client/test/GetCurrentOpenApiReferenceTest.cs index 1b6abc9f27..9e076cefc3 100644 --- a/src/Tools/Extensions.ApiDescription.Client/test/GetCurrentOpenApiReferenceTest.cs +++ b/src/Tools/Extensions.ApiDescription.Client/test/GetCurrentOpenApiReferenceTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.ApiDescription.Client public void Execute_ReturnsExpectedItem() { // Arrange - string input = "Identity=../files/azureMonitor.json|ClassName=azureMonitorClient|" + + var input = "Identity=../files/azureMonitor.json|ClassName=azureMonitorClient|" + "CodeGenerator=NSwagCSharp|Namespace=ConsoleClient|Options=|OutputPath=" + "C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs|" + "OriginalItemSpec=../files/azureMonitor.json|FirstForGenerator=true"; @@ -22,8 +22,8 @@ namespace Microsoft.Extensions.ApiDescription.Client Input = input, }; - string expectedIdentity = "../files/azureMonitor.json"; - IDictionary expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + var expectedIdentity = "../files/azureMonitor.json"; + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", "azureMonitorClient" }, { "CodeGenerator", "NSwagCSharp" }, diff --git a/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs b/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs index 7bc5cc7fb9..3602ea1c56 100644 --- a/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs +++ b/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs @@ -27,7 +27,7 @@ namespace Microsoft.Extensions.ApiDescription.Client OutputDirectory = "obj", }; - IDictionary expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", "NSwagClient" }, { "CodeGenerator", "NSwagCSharp" }, @@ -85,7 +85,7 @@ namespace Microsoft.Extensions.ApiDescription.Client OutputDirectory = "obj", }; - IDictionary expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", className }, { "CodeGenerator", "NSwagCSharp" }, @@ -143,7 +143,7 @@ namespace Microsoft.Extensions.ApiDescription.Client OutputDirectory = "obj", }; - IDictionary expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", "NSwagClient" }, { "CodeGenerator", "NSwagCSharp" }, @@ -201,7 +201,7 @@ namespace Microsoft.Extensions.ApiDescription.Client OutputDirectory = "bin", }; - IDictionary expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", className }, { "CodeGenerator", "NSwagCSharp" }, @@ -351,7 +351,7 @@ namespace Microsoft.Extensions.ApiDescription.Client OutputDirectory = "bin", }; - IDictionary expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", className }, { "CodeGenerator", "NSwagCSharp" }, @@ -414,7 +414,7 @@ namespace Microsoft.Extensions.ApiDescription.Client OutputDirectory = "bin", }; - IDictionary expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", className }, { "CodeGenerator", "NSwagCSharp" }, @@ -481,7 +481,7 @@ namespace Microsoft.Extensions.ApiDescription.Client OutputDirectory = "obj", }; - IDictionary expectedMetadata1 = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata1 = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", className12 }, { "CodeGenerator", codeGenerator13 }, @@ -496,7 +496,7 @@ namespace Microsoft.Extensions.ApiDescription.Client $"OutputPath={outputPath1}|ClassName={className12}|Namespace={@namespace}" }, }; - IDictionary expectedMetadata2 = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata2 = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", className12 }, { "CodeGenerator", codeGenerator2 }, @@ -511,7 +511,7 @@ namespace Microsoft.Extensions.ApiDescription.Client $"OutputPath={outputPath2}|ClassName={className12}|Namespace={@namespace}" }, }; - IDictionary expectedMetadata3 = new SortedDictionary(StringComparer.Ordinal) + var expectedMetadata3 = new SortedDictionary(StringComparer.Ordinal) { { "ClassName", className3 }, { "CodeGenerator", codeGenerator13 }, diff --git a/src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs b/src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs new file mode 100644 index 0000000000..adc889ccac --- /dev/null +++ b/src/Tools/Extensions.ApiDescription.Client/test/MetadataSerializerTest.cs @@ -0,0 +1,314 @@ +// 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; +using System.Collections.Generic; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using Moq; +using Xunit; + +namespace Microsoft.Extensions.ApiDescription.Client +{ + // ItemSpec values always have '\\' converted to '/' on input when running on non-Windows. It is not possible to + // retrieve the original (unconverted) item spec value. In other respects, item spec values are treated identically + // to custom metadata values. + // + // ITaskItem members aka the implicitly-implemented methods and properties in TaskItem expect _escaped_ values on + // input and return _literal_ values. This includes TaskItem constructors and CloneCustomMetadata() (which returns + // a new dictionary containing literal values). TaskItem stores all values in their escaped form. + // + // Added ITaskItem2 members e.g. CloneCustomMetadataEscaped(), GetMetadataValueEscaped(...) and + // EvaluatedIncludeEscaped return escaped values. Of all TaskItem methods, only SetMetadataValueLiteral(...) + // accepts a literal input value. + // + // Metadata names are never escaped. + // + // MetadataSerializer expects literal values on input. + public class MetadataSerializerTest + { + // Maps literal to escaped values. + public static TheoryData EscapedValuesMapping { get; } = new TheoryData + { + { "No escaping necessary for =.", "No escaping necessary for =." }, + { "Value needs escaping? (yes)", "Value needs escaping%3f %28yes%29" }, + { "$ comes earlier; @ comes later.", "%24 comes earlier%3b %40 comes later." }, + { + "A '%' *character* needs escaping %-escaping.", + "A %27%25%27 %2acharacter%2a needs escaping %25-escaping." + }, + }; + + public static TheoryData EscapedValues + { + get + { + var result = new TheoryData(); + foreach (var entry in EscapedValuesMapping) + { + result.Add((string)entry[1]); + } + + return result; + } + } + + public static TheoryData LiteralValues + { + get + { + var result = new TheoryData(); + foreach (var entry in EscapedValuesMapping) + { + result.Add((string)entry[0]); + } + + return result; + } + } + + [Theory] + [MemberData(nameof(LiteralValues))] + public void SetMetadata_UpdatesTaskAsExpected(string value) + { + // Arrange + var item = new TaskItem("My Identity"); + var key = "My key"; + + // Act + MetadataSerializer.SetMetadata(item, key, value); + + // Assert + Assert.Equal(value, item.GetMetadata(key)); + } + + [Theory] + [MemberData(nameof(EscapedValuesMapping))] + public void SetMetadata_UpdatesTaskAsExpected_WithLegacyItem(string value, string escapedValue) + { + // Arrange + var item = new Mock(MockBehavior.Strict); + var key = "My key"; + item.Setup(i => i.SetMetadata(key, escapedValue)).Verifiable(); + + // Act + MetadataSerializer.SetMetadata(item.Object, key, value); + + // Assert + item.Verify(i => i.SetMetadata(key, escapedValue), Times.Once); + } + + [Fact] + public void DeserializeMetadata_ReturnsExpectedTask() + { + // Arrange + var identity = "../files/azureMonitor.json"; + var input = $"Identity={identity}|ClassName=azureMonitorClient|" + + "CodeGenerator=NSwagCSharp|FirstForGenerator=true|Namespace=ConsoleClient|" + + "Options=|OriginalItemSpec=../files/azureMonitor.json|" + + "OutputPath=C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs"; + + var expectedMetadata = new SortedDictionary(StringComparer.Ordinal) + { + { "ClassName", "azureMonitorClient" }, + { "CodeGenerator", "NSwagCSharp" }, + { "FirstForGenerator", "true" }, + { "Namespace", "ConsoleClient" }, + { "Options", "" }, + { "OriginalItemSpec", identity }, + { "OutputPath", "C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs" }, + }; + + // Act + var item = MetadataSerializer.DeserializeMetadata(input); + + // Assert + Assert.Equal(identity, item.ItemSpec); + var metadata = Assert.IsAssignableFrom>(item.CloneCustomMetadata()); + + // The dictionary CloneCustomMetadata returns doesn't provide a useful KeyValuePair enumerator. + var orderedMetadata = new SortedDictionary(StringComparer.Ordinal); + foreach (var key in metadata.Keys) + { + orderedMetadata.Add(key, metadata[key]); + } + + Assert.Equal(expectedMetadata, orderedMetadata); + + } + + [Theory] + [MemberData(nameof(EscapedValuesMapping))] + public void DeserializeMetadata_ReturnsExpectedTask_WhenEscaping(string value, string escapedValue) + { + // Arrange + var identity = "../files/azureMonitor.json"; + var input = $"Identity={identity}|Value={escapedValue}"; + + // Act + var item = MetadataSerializer.DeserializeMetadata(input); + + // Assert + Assert.Equal(identity, item.ItemSpec); + Assert.Equal(value, item.GetMetadata("Value")); + } + + [Theory] + [MemberData(nameof(EscapedValuesMapping))] + public void DeserializeMetadata_ReturnsExpectedTask_WhenEscapingIdentity(string value, string escapedValue) + { + // Arrange + var input = $"Identity={escapedValue}|Value=a value"; + + // Act + var item = MetadataSerializer.DeserializeMetadata(input); + + // Assert + Assert.Equal(value, item.ItemSpec); + Assert.Equal("a value", item.GetMetadata("Value")); + } + + [Fact] + public void SerializeMetadata_ReturnsExpectedString() + { + // Arrange + var identity = "../files/azureMonitor.json"; + var metadata = new SortedDictionary(StringComparer.Ordinal) + { + { "ClassName", "azureMonitorClient" }, + { "CodeGenerator", "NSwagCSharp" }, + { "FirstForGenerator", "true" }, + { "Namespace", "ConsoleClient" }, + { "Options", "" }, + { "OriginalItemSpec", identity }, + { "OutputPath", "C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs" }, + }; + + var input = new TaskItem(identity, metadata); + var expectedResult = $"Identity={identity}|ClassName=azureMonitorClient|" + + "CodeGenerator=NSwagCSharp|FirstForGenerator=true|Namespace=ConsoleClient|" + + "Options=|OriginalItemSpec=../files/azureMonitor.json|" + + "OutputPath=C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs"; + + // Act + var result = MetadataSerializer.SerializeMetadata(input); + + // Assert + Assert.Equal(expectedResult, result); + } + + [Theory] + [MemberData(nameof(EscapedValues))] + public void SerializeMetadata_ReturnsExpectedString_WhenEscaping(string escapedValue) + { + // Arrange + var identity = "../files/azureMonitor.json"; + var expectedResult = $"Identity={identity}|Value={escapedValue}"; + var metadata = new SortedDictionary(StringComparer.Ordinal) { { "Value", escapedValue } }; + var input = new TaskItem(identity, metadata); + + // Act + var result = MetadataSerializer.SerializeMetadata(input); + + // Assert + Assert.Equal(expectedResult, result); + } + + [Theory] + [MemberData(nameof(EscapedValues))] + public void SerializeMetadata_ReturnsExpectedString_WhenEscapingIdentity(string escapedValue) + { + // Arrange + var metadata = new SortedDictionary(StringComparer.Ordinal) { { "Value", "a value" } }; + var expectedResult = $"Identity={escapedValue}|Value=a value"; + var input = new TaskItem(escapedValue, metadata); + + // Act + var result = MetadataSerializer.SerializeMetadata(input); + + // Assert + Assert.Equal(expectedResult, result); + } + + [Fact] + public void SerializeMetadata_ReturnsExpectedString_WithLegacyItem() + { + // Arrange + var identity = "../files/azureMonitor.json"; + var metadata = new SortedDictionary(StringComparer.Ordinal) + { + { "ClassName", "azureMonitorClient" }, + { "CodeGenerator", "NSwagCSharp" }, + { "FirstForGenerator", "true" }, + { "Namespace", "ConsoleClient" }, + { "Options", "" }, + { "OriginalItemSpec", identity }, + { "OutputPath", "C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs" }, + }; + + var input = new Mock(MockBehavior.Strict); + input.SetupGet(i => i.ItemSpec).Returns(identity).Verifiable(); + input.Setup(i => i.CloneCustomMetadata()).Returns(metadata).Verifiable(); + + var expectedResult = $"Identity={identity}|ClassName=azureMonitorClient|" + + "CodeGenerator=NSwagCSharp|FirstForGenerator=true|Namespace=ConsoleClient|" + + "Options=|OriginalItemSpec=../files/azureMonitor.json|" + + "OutputPath=C:\\dd\\dnx\\AspNetCore\\artifacts\\obj\\ConsoleClient\\azureMonitorClient.cs"; + + // Act + var result = MetadataSerializer.SerializeMetadata(input.Object); + + // Assert + Assert.Equal(expectedResult, result); + input.VerifyGet(i => i.ItemSpec, Times.Once); + input.Verify(i => i.CloneCustomMetadata(), Times.Once); + } + + [Theory] + [MemberData(nameof(EscapedValuesMapping))] + public void SerializeMetadata_ReturnsExpectedString_WithLegacyItem_WhenEscaping( + string value, + string escapedValue) + { + // Arrange + var identity = "../files/azureMonitor.json"; + var metadata = new SortedDictionary(StringComparer.Ordinal) { { "Value", value } }; + var input = new Mock(MockBehavior.Strict); + input.SetupGet(i => i.ItemSpec).Returns(identity).Verifiable(); + input.Setup(i => i.CloneCustomMetadata()).Returns(metadata).Verifiable(); + + var expectedResult = $"Identity={identity}|Value={escapedValue}"; + + // Act + var result = MetadataSerializer.SerializeMetadata(input.Object); + + // Assert + Assert.Equal(expectedResult, result); + input.VerifyGet(i => i.ItemSpec, Times.Once); + input.Verify(i => i.CloneCustomMetadata(), Times.Once); + } + + [Theory] + [MemberData(nameof(EscapedValuesMapping))] + public void SerializeMetadata_ReturnsExpectedString_WithLegacyItem_WhenEscapingIdentity( + string value, + string escapedValue) + { + // Arrange + var metadata = new SortedDictionary(StringComparer.Ordinal) { { "Value", "a value" } }; + var input = new Mock(MockBehavior.Strict); + input.SetupGet(i => i.ItemSpec).Returns(value).Verifiable(); + input.Setup(i => i.CloneCustomMetadata()).Returns(metadata).Verifiable(); + + var expectedResult = $"Identity={escapedValue}|Value=a value"; + + // Act + var result = MetadataSerializer.SerializeMetadata(input.Object); + + // Assert + Assert.Equal(expectedResult, result); + input.VerifyGet(i => i.ItemSpec, Times.Once); + input.Verify(i => i.CloneCustomMetadata(), Times.Once); + } + } +} From 0019148893baae3c930370202a4ab58200e01c92 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sun, 29 Sep 2019 11:58:17 -0700 Subject: [PATCH 08/15] Update branding to 3.1.0-preview2 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 7540f5e7a2..bff22c3e00 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -9,7 +9,7 @@ 3 1 0 - 1 + 2 From aa84cd643cb7c162d01595d7a4b1a2221233d6b4 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Mon, 30 Sep 2019 12:47:42 -0700 Subject: [PATCH 09/15] Use a response file for GenAPI commands - work around dotnet/arcade#4021 --- eng/targets/ReferenceAssembly.targets | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/eng/targets/ReferenceAssembly.targets b/eng/targets/ReferenceAssembly.targets index f516f1b07a..765cc16932 100644 --- a/eng/targets/ReferenceAssembly.targets +++ b/eng/targets/ReferenceAssembly.targets @@ -61,15 +61,21 @@ + <_GenApiFile>$([MSBuild]::NormalizePath('$(ArtifactsDir)', 'log', 'GenAPI.rsp')) <_GenAPICommand Condition="'$(MSBuildRuntimeType)' == 'core'">"$(DotNetTool)" --roll-forward-on-no-candidate-fx 2 "$(_GenAPIPath)" - <_GenAPICmd>$(_GenAPICommand) - <_GenAPICmd>$(_GenAPICmd) "$(TargetPath)" - <_GenAPICmd>$(_GenAPICmd) --lib-path "@(_ReferencePathDirectories)" - <_GenAPICmd>$(_GenAPICmd) --out "$(_RefSourceFileOutputPath)" - <_GenAPICmd>$(_GenAPICmd) --header-file "$(RepoRoot)/eng/LicenseHeader.txt" - <_GenAPICmd>$(_GenAPICmd) --exclude-api-list "$(RepoRoot)/eng/GenAPI.exclusions.txt" + <_GenAPICmd>$(_GenAPICommand) @"$(_GenApiFile)" + <_GenApiArguments> + + + @@ -96,4 +102,4 @@ - \ No newline at end of file + From f6eab78cd9c3cfe3741defbb15920e7ce2d67410 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sun, 29 Sep 2019 23:20:23 -0700 Subject: [PATCH 10/15] Find or install Tar on CI - work around dotnet/core-eng#7970 - install Git in repo if Tar can't be found in usual locations - use found or installed Tar in Microsoft.AspNetCore.App.Ref project - copy into repo from wherever it's found - add lots of `Write-Host` debugging nit: clean up / comment on VS Code warnings about build.ps1 --- .azure/pipelines/jobs/default-build.yml | 4 + build.ps1 | 18 +++-- eng/scripts/InstallTar.ps1 | 76 +++++++++++++++++++ global.json | 1 + .../ref/Microsoft.AspNetCore.App.Ref.csproj | 26 ++++++- 5 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 eng/scripts/InstallTar.ps1 diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index a136f3871f..d218c44531 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -55,6 +55,7 @@ parameters: artifacts: [] buildDirectory: '' buildScript: '' + installTar: true installNodeJs: true installJdk: true timeoutInMinutes: 180 @@ -151,6 +152,9 @@ jobs: Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(BuildDirectory)\artifacts\tmp\selenium\" ./eng/scripts/InstallGoogleChrome.ps1 displayName: Install Chrome + - ${{ if and(eq(parameters.installTar, 'true'), eq(parameters.agentOs, 'Windows')) }}: + - powershell: ./eng/scripts/InstallTar.ps1 + displayName: Find or install Tar - ${{ parameters.beforeBuild }} diff --git a/build.ps1 b/build.ps1 index 17020044ed..c515a84af5 100644 --- a/build.ps1 +++ b/build.ps1 @@ -307,6 +307,8 @@ if (-not $foundJdk -and $RunBuild -and ($All -or $BuildJava) -and -not $NoBuildJ # Initialize global variables need to be set before the import of Arcade is imported $restore = $RunRestore +# Though VS Code may indicate $nodeReuse, $warnAsError and $msbuildEngine are unused, tools.ps1 uses them. + # Disable node reuse - Workaround perpetual issues in node reuse and custom task assemblies $nodeReuse = $false $env:MSBUILDDISABLENODEREUSE=1 @@ -328,10 +330,10 @@ if ($CI) { } # tools.ps1 corrupts global state, so reset these values in case they carried over from a previous build -rm variable:global:_BuildTool -ea Ignore -rm variable:global:_DotNetInstallDir -ea Ignore -rm variable:global:_ToolsetBuildProj -ea Ignore -rm variable:global:_MSBuildExe -ea Ignore +Remove-Item variable:global:_BuildTool -ea Ignore +Remove-Item variable:global:_DotNetInstallDir -ea Ignore +Remove-Item variable:global:_ToolsetBuildProj -ea Ignore +Remove-Item variable:global:_MSBuildExe -ea Ignore # Import Arcade . "$PSScriptRoot/eng/common/tools.ps1" @@ -391,10 +393,10 @@ finally { } # tools.ps1 corrupts global state, so reset these values so they don't carry between invocations of build.ps1 - rm variable:global:_BuildTool -ea Ignore - rm variable:global:_DotNetInstallDir -ea Ignore - rm variable:global:_ToolsetBuildProj -ea Ignore - rm variable:global:_MSBuildExe -ea Ignore + Remove-Item variable:global:_BuildTool -ea Ignore + Remove-Item variable:global:_DotNetInstallDir -ea Ignore + Remove-Item variable:global:_ToolsetBuildProj -ea Ignore + Remove-Item variable:global:_MSBuildExe -ea Ignore if ($DumpProcesses -or $ci) { Stop-Job -Name DumpProcesses diff --git a/eng/scripts/InstallTar.ps1 b/eng/scripts/InstallTar.ps1 new file mode 100644 index 0000000000..93f419b213 --- /dev/null +++ b/eng/scripts/InstallTar.ps1 @@ -0,0 +1,76 @@ +<# +.SYNOPSIS + Finds or installs the Tar command on this system. +.DESCRIPTION + This script searches for Tar on this system. If not found, downloads and extracts Git to use its tar.exe. Prefers + global installation locations even if Git has been downloaded into this repo. +.PARAMETER GitVersion + The version of the Git to install. If not set, the default value is read from global.json. +.PARAMETER Force + Overwrite the existing installation if one exists in this repo and Tar isn't installed globally. +#> +param( + [string]$GitVersion, + [switch]$Force +) + +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 + +Set-StrictMode -Version 1 + +# Find tar. If not found, install Git to get it. +$repoRoot = (Join-Path $PSScriptRoot "..\.." -Resolve) +$installDir = "$repoRoot\.tools\Git\win-x64" +$tarCommand = "$installDir\usr\bin\tar.exe" +$finalCommand = "$repoRoot\.tools\tar.exe" + +Write-Host "Windows version and other information, because who knows" +cmd.exe /c ver +systeminfo.exe + +Write-Host "Processor Architecture: $env:PROCESSOR_ARCHITECTURE" +Write-Host "Dumping environment" +Get-ChildItem env:\ + +Write-Host "Checking $env:SystemRoot\System32\tar.exe" +Get-ChildItem "$env:SystemRoot\System32\ta*.exe" +if (Test-Path "$env:SystemRoot\System32\tar.exe") { + Write-Host "Found $env:SystemRoot\System32\tar.exe" + $tarCommand = "$env:SystemRoot\System32\tar.exe" +} +elseif (Test-Path "$env:ProgramFiles\Git\usr\bin\tar.exe") { + $tarCommand = "$env:ProgramFiles\Git\usr\bin\tar.exe" +} +elseif (Test-Path "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe") { + $tarCommand = "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe" +} +elseif (Test-Path "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe") { + $tarCommand = "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe" +} +elseif ((Test-Path $tarCommand) -And (-Not $Force)) { + Write-Verbose "Repo-local Git installation and $tarCommand already exist, skipping Git install." +} +else { + if (-not $GitVersion) { + $globalJson = Get-Content "$repoRoot\global.json" | ConvertFrom-Json + $GitVersion = $globalJson.tools.Git + } + + $Uri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/git/Git-${GitVersion}-64-bit.zip" + + Import-Module -Name (Join-Path $PSScriptRoot "..\common\native\CommonLibrary.psm1" -Resolve) + $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri -InstallDirectory "$installDir\" -Force:$Force -Verbose + + if ($InstallStatus -Eq $False) { + Write-Error "Installation failed" + exit 1 + } +} + +Copy-Item "$tarCommand" "$finalCommand" -Verbose +Write-Host "Tar now available at '$finalCommand'" + +if ($tarCommand -like '*\Git\*') { + $null >.\.tools\tar.fromGit +} diff --git a/global.json b/global.json index 41b9856784..256d50f24e 100644 --- a/global.json +++ b/global.json @@ -12,6 +12,7 @@ "$(MicrosoftNETCoreAppRuntimeVersion)" ] }, + "Git": "2.22.0", "jdk": "11.0.3", "vs": { "version": "16.0", diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj index 00c9026c5a..ef06af8da3 100644 --- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj @@ -171,14 +171,34 @@ This package is an internal implementation of the .NET Core SDK and is not meant Inputs="@(RefPackContent)" Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)" Condition="'$(IsPackable)' == 'true'"> + + <_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe + <_TarCommand Condition="'$(_TarCommand)' == ''">tar + + + <_TarArchiveOutputPath>$(TarArchiveOutputPath) + <_TarArchiveOutputPath + Condition="Exists('$(repoRoot)\.tools\tar.fromGit')">/$(TarArchiveOutputPath.Replace('\','/').Replace(':','')) + + + - + + + + + + From 111462e0c24fc92c75225ed563af4051c2e43d30 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Mon, 30 Sep 2019 12:47:42 -0700 Subject: [PATCH 11/15] Use a response file for GenAPI commands - work around dotnet/arcade#4021 --- eng/targets/ReferenceAssembly.targets | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/eng/targets/ReferenceAssembly.targets b/eng/targets/ReferenceAssembly.targets index f516f1b07a..765cc16932 100644 --- a/eng/targets/ReferenceAssembly.targets +++ b/eng/targets/ReferenceAssembly.targets @@ -61,15 +61,21 @@ + <_GenApiFile>$([MSBuild]::NormalizePath('$(ArtifactsDir)', 'log', 'GenAPI.rsp')) <_GenAPICommand Condition="'$(MSBuildRuntimeType)' == 'core'">"$(DotNetTool)" --roll-forward-on-no-candidate-fx 2 "$(_GenAPIPath)" - <_GenAPICmd>$(_GenAPICommand) - <_GenAPICmd>$(_GenAPICmd) "$(TargetPath)" - <_GenAPICmd>$(_GenAPICmd) --lib-path "@(_ReferencePathDirectories)" - <_GenAPICmd>$(_GenAPICmd) --out "$(_RefSourceFileOutputPath)" - <_GenAPICmd>$(_GenAPICmd) --header-file "$(RepoRoot)/eng/LicenseHeader.txt" - <_GenAPICmd>$(_GenAPICmd) --exclude-api-list "$(RepoRoot)/eng/GenAPI.exclusions.txt" + <_GenAPICmd>$(_GenAPICommand) @"$(_GenApiFile)" + <_GenApiArguments> + + + @@ -96,4 +102,4 @@ - \ No newline at end of file + From 477fa8ce4c179d18c9e1078343ad4df0ed41bc92 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sun, 29 Sep 2019 23:20:23 -0700 Subject: [PATCH 12/15] Find or install Tar on CI - work around dotnet/core-eng#7970 - install Git in repo if Tar can't be found in usual locations - use found or installed Tar in Microsoft.AspNetCore.App.Ref project - copy into repo from wherever it's found - add lots of `Write-Host` debugging nit: clean up / comment on VS Code warnings about build.ps1 --- .azure/pipelines/jobs/default-build.yml | 4 + build.ps1 | 18 +++-- eng/scripts/InstallTar.ps1 | 76 +++++++++++++++++++ global.json | 1 + .../ref/Microsoft.AspNetCore.App.Ref.csproj | 26 ++++++- 5 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 eng/scripts/InstallTar.ps1 diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index a136f3871f..d218c44531 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -55,6 +55,7 @@ parameters: artifacts: [] buildDirectory: '' buildScript: '' + installTar: true installNodeJs: true installJdk: true timeoutInMinutes: 180 @@ -151,6 +152,9 @@ jobs: Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(BuildDirectory)\artifacts\tmp\selenium\" ./eng/scripts/InstallGoogleChrome.ps1 displayName: Install Chrome + - ${{ if and(eq(parameters.installTar, 'true'), eq(parameters.agentOs, 'Windows')) }}: + - powershell: ./eng/scripts/InstallTar.ps1 + displayName: Find or install Tar - ${{ parameters.beforeBuild }} diff --git a/build.ps1 b/build.ps1 index 17020044ed..c515a84af5 100644 --- a/build.ps1 +++ b/build.ps1 @@ -307,6 +307,8 @@ if (-not $foundJdk -and $RunBuild -and ($All -or $BuildJava) -and -not $NoBuildJ # Initialize global variables need to be set before the import of Arcade is imported $restore = $RunRestore +# Though VS Code may indicate $nodeReuse, $warnAsError and $msbuildEngine are unused, tools.ps1 uses them. + # Disable node reuse - Workaround perpetual issues in node reuse and custom task assemblies $nodeReuse = $false $env:MSBUILDDISABLENODEREUSE=1 @@ -328,10 +330,10 @@ if ($CI) { } # tools.ps1 corrupts global state, so reset these values in case they carried over from a previous build -rm variable:global:_BuildTool -ea Ignore -rm variable:global:_DotNetInstallDir -ea Ignore -rm variable:global:_ToolsetBuildProj -ea Ignore -rm variable:global:_MSBuildExe -ea Ignore +Remove-Item variable:global:_BuildTool -ea Ignore +Remove-Item variable:global:_DotNetInstallDir -ea Ignore +Remove-Item variable:global:_ToolsetBuildProj -ea Ignore +Remove-Item variable:global:_MSBuildExe -ea Ignore # Import Arcade . "$PSScriptRoot/eng/common/tools.ps1" @@ -391,10 +393,10 @@ finally { } # tools.ps1 corrupts global state, so reset these values so they don't carry between invocations of build.ps1 - rm variable:global:_BuildTool -ea Ignore - rm variable:global:_DotNetInstallDir -ea Ignore - rm variable:global:_ToolsetBuildProj -ea Ignore - rm variable:global:_MSBuildExe -ea Ignore + Remove-Item variable:global:_BuildTool -ea Ignore + Remove-Item variable:global:_DotNetInstallDir -ea Ignore + Remove-Item variable:global:_ToolsetBuildProj -ea Ignore + Remove-Item variable:global:_MSBuildExe -ea Ignore if ($DumpProcesses -or $ci) { Stop-Job -Name DumpProcesses diff --git a/eng/scripts/InstallTar.ps1 b/eng/scripts/InstallTar.ps1 new file mode 100644 index 0000000000..93f419b213 --- /dev/null +++ b/eng/scripts/InstallTar.ps1 @@ -0,0 +1,76 @@ +<# +.SYNOPSIS + Finds or installs the Tar command on this system. +.DESCRIPTION + This script searches for Tar on this system. If not found, downloads and extracts Git to use its tar.exe. Prefers + global installation locations even if Git has been downloaded into this repo. +.PARAMETER GitVersion + The version of the Git to install. If not set, the default value is read from global.json. +.PARAMETER Force + Overwrite the existing installation if one exists in this repo and Tar isn't installed globally. +#> +param( + [string]$GitVersion, + [switch]$Force +) + +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 + +Set-StrictMode -Version 1 + +# Find tar. If not found, install Git to get it. +$repoRoot = (Join-Path $PSScriptRoot "..\.." -Resolve) +$installDir = "$repoRoot\.tools\Git\win-x64" +$tarCommand = "$installDir\usr\bin\tar.exe" +$finalCommand = "$repoRoot\.tools\tar.exe" + +Write-Host "Windows version and other information, because who knows" +cmd.exe /c ver +systeminfo.exe + +Write-Host "Processor Architecture: $env:PROCESSOR_ARCHITECTURE" +Write-Host "Dumping environment" +Get-ChildItem env:\ + +Write-Host "Checking $env:SystemRoot\System32\tar.exe" +Get-ChildItem "$env:SystemRoot\System32\ta*.exe" +if (Test-Path "$env:SystemRoot\System32\tar.exe") { + Write-Host "Found $env:SystemRoot\System32\tar.exe" + $tarCommand = "$env:SystemRoot\System32\tar.exe" +} +elseif (Test-Path "$env:ProgramFiles\Git\usr\bin\tar.exe") { + $tarCommand = "$env:ProgramFiles\Git\usr\bin\tar.exe" +} +elseif (Test-Path "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe") { + $tarCommand = "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe" +} +elseif (Test-Path "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe") { + $tarCommand = "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe" +} +elseif ((Test-Path $tarCommand) -And (-Not $Force)) { + Write-Verbose "Repo-local Git installation and $tarCommand already exist, skipping Git install." +} +else { + if (-not $GitVersion) { + $globalJson = Get-Content "$repoRoot\global.json" | ConvertFrom-Json + $GitVersion = $globalJson.tools.Git + } + + $Uri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/git/Git-${GitVersion}-64-bit.zip" + + Import-Module -Name (Join-Path $PSScriptRoot "..\common\native\CommonLibrary.psm1" -Resolve) + $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri -InstallDirectory "$installDir\" -Force:$Force -Verbose + + if ($InstallStatus -Eq $False) { + Write-Error "Installation failed" + exit 1 + } +} + +Copy-Item "$tarCommand" "$finalCommand" -Verbose +Write-Host "Tar now available at '$finalCommand'" + +if ($tarCommand -like '*\Git\*') { + $null >.\.tools\tar.fromGit +} diff --git a/global.json b/global.json index 41b9856784..256d50f24e 100644 --- a/global.json +++ b/global.json @@ -12,6 +12,7 @@ "$(MicrosoftNETCoreAppRuntimeVersion)" ] }, + "Git": "2.22.0", "jdk": "11.0.3", "vs": { "version": "16.0", diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj index 00c9026c5a..ef06af8da3 100644 --- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj @@ -171,14 +171,34 @@ This package is an internal implementation of the .NET Core SDK and is not meant Inputs="@(RefPackContent)" Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)" Condition="'$(IsPackable)' == 'true'"> + + <_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe + <_TarCommand Condition="'$(_TarCommand)' == ''">tar + + + <_TarArchiveOutputPath>$(TarArchiveOutputPath) + <_TarArchiveOutputPath + Condition="Exists('$(repoRoot)\.tools\tar.fromGit')">/$(TarArchiveOutputPath.Replace('\','/').Replace(':','')) + + + - + + + + + + From 219b528ac2eab39fd835f733f56ba9b5520596c5 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Mon, 30 Sep 2019 19:14:00 -0700 Subject: [PATCH 13/15] Create missing directory and simplify workaround slightly --- eng/scripts/InstallTar.ps1 | 6 ++---- .../ref/Microsoft.AspNetCore.App.Ref.csproj | 14 +++----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/eng/scripts/InstallTar.ps1 b/eng/scripts/InstallTar.ps1 index 93f419b213..12159a8d0b 100644 --- a/eng/scripts/InstallTar.ps1 +++ b/eng/scripts/InstallTar.ps1 @@ -25,13 +25,10 @@ $installDir = "$repoRoot\.tools\Git\win-x64" $tarCommand = "$installDir\usr\bin\tar.exe" $finalCommand = "$repoRoot\.tools\tar.exe" -Write-Host "Windows version and other information, because who knows" +Write-Host "Windows version and other information..." cmd.exe /c ver systeminfo.exe - Write-Host "Processor Architecture: $env:PROCESSOR_ARCHITECTURE" -Write-Host "Dumping environment" -Get-ChildItem env:\ Write-Host "Checking $env:SystemRoot\System32\tar.exe" Get-ChildItem "$env:SystemRoot\System32\ta*.exe" @@ -68,6 +65,7 @@ else { } } +New-Item "$repoRoot\.tools\" -ErrorAction SilentlyContinue -ItemType Directory Copy-Item "$tarCommand" "$finalCommand" -Verbose Write-Host "Tar now available at '$finalCommand'" diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj index ef06af8da3..a60b73a3cd 100644 --- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj @@ -172,8 +172,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)" Condition="'$(IsPackable)' == 'true'"> + <_TarCommand>tar <_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe - <_TarCommand Condition="'$(_TarCommand)' == ''">tar <_TarArchiveOutputPath>$(TarArchiveOutputPath) @@ -187,17 +187,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant Overwrite="true" /> - - + - - + WorkingDirectory="$(TargetingPackLayoutRoot)" /> From c31c5143be9f3612af6c8a2eabbdae5aa2015166 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Mon, 30 Sep 2019 19:14:00 -0700 Subject: [PATCH 14/15] Create missing directory and simplify workaround slightly --- eng/scripts/InstallTar.ps1 | 6 ++---- .../ref/Microsoft.AspNetCore.App.Ref.csproj | 14 +++----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/eng/scripts/InstallTar.ps1 b/eng/scripts/InstallTar.ps1 index 93f419b213..12159a8d0b 100644 --- a/eng/scripts/InstallTar.ps1 +++ b/eng/scripts/InstallTar.ps1 @@ -25,13 +25,10 @@ $installDir = "$repoRoot\.tools\Git\win-x64" $tarCommand = "$installDir\usr\bin\tar.exe" $finalCommand = "$repoRoot\.tools\tar.exe" -Write-Host "Windows version and other information, because who knows" +Write-Host "Windows version and other information..." cmd.exe /c ver systeminfo.exe - Write-Host "Processor Architecture: $env:PROCESSOR_ARCHITECTURE" -Write-Host "Dumping environment" -Get-ChildItem env:\ Write-Host "Checking $env:SystemRoot\System32\tar.exe" Get-ChildItem "$env:SystemRoot\System32\ta*.exe" @@ -68,6 +65,7 @@ else { } } +New-Item "$repoRoot\.tools\" -ErrorAction SilentlyContinue -ItemType Directory Copy-Item "$tarCommand" "$finalCommand" -Verbose Write-Host "Tar now available at '$finalCommand'" diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj index ef06af8da3..a60b73a3cd 100644 --- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj @@ -172,8 +172,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)" Condition="'$(IsPackable)' == 'true'"> + <_TarCommand>tar <_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe - <_TarCommand Condition="'$(_TarCommand)' == ''">tar <_TarArchiveOutputPath>$(TarArchiveOutputPath) @@ -187,17 +187,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant Overwrite="true" /> - - + - - + WorkingDirectory="$(TargetingPackLayoutRoot)" /> From 903b9d33336600040da6d9769eccb0c891d72714 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Tue, 1 Oct 2019 12:12:56 -0700 Subject: [PATCH 15/15] Undo unintended change to alpha2 branding --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index fff5d0df67..4ffd700107 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -9,7 +9,7 @@ 5 0 0 - 2 + 1