Skip to content

Commit 3f07db0

Browse files
committed
Merge branch 'release/5.0'
2 parents 3892b4e + 9df997c commit 3f07db0

File tree

9 files changed

+100
-24
lines changed

9 files changed

+100
-24
lines changed

eng/Versions.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
<AspNetCoreMajorVersion>5</AspNetCoreMajorVersion>
1010
<AspNetCoreMinorVersion>0</AspNetCoreMinorVersion>
1111
<AspNetCorePatchVersion>0</AspNetCorePatchVersion>
12-
<PreReleaseVersionIteration>2</PreReleaseVersionIteration>
1312
<!--
1413
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
1514
-->
1615
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
1716
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
18-
<PreReleaseVersionLabel>rc</PreReleaseVersionLabel>
19-
<PreReleaseBrandingLabel>RC $(PreReleaseVersionIteration)</PreReleaseBrandingLabel>
17+
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
18+
<PreReleaseBrandingLabel>RTM $(PreReleaseVersionIteration)</PreReleaseBrandingLabel>
2019
<IncludePreReleaseLabelInPackageVersion>true</IncludePreReleaseLabelInPackageVersion>
2120
<IncludePreReleaseLabelInPackageVersion Condition=" '$(DotNetFinalVersionKind)' == 'release' ">false</IncludePreReleaseLabelInPackageVersion>
2221
<AspNetCoreMajorMinorVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</AspNetCoreMajorMinorVersion>

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Boot.Server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ async function boot(userOptions?: Partial<CircuitStartOptions>): Promise<void> {
6767
}
6868
};
6969

70-
window.addEventListener('beforeunload', cleanup, { capture: false, once: true });
70+
window['Blazor'].disconnect = cleanup;
71+
7172
window.addEventListener('unload', cleanup, { capture: false, once: true });
7273

7374
window['Blazor'].reconnect = reconnect;

src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public override async Task InitializeAsync()
4444
protected override void InitializeAsyncCore()
4545
{
4646
Navigate(ServerPathBase, noReload: false);
47-
Browser.MountTestComponent<CounterComponent>();
48-
Browser.Equal("Current count: 0", () => Browser.FindElement(By.TagName("p")).Text);
47+
Browser.MountTestComponent<GracefulTermination>();
48+
Browser.Equal("Graceful Termination", () => Browser.FindElement(By.TagName("h1")).Text);
4949

5050
GracefulDisconnectCompletionSource = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
5151
Sink = _serverFixture.Host.Services.GetRequiredService<TestSink>();
@@ -91,6 +91,45 @@ public async Task ClosingTheBrowserWindow_GracefullyDisconnects_WhenNavigatingAw
9191
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
9292
}
9393

94+
[Fact]
95+
public async Task NavigatingToProtocolLink_DoesNotGracefullyDisconnect_TheCurrentCircuit()
96+
{
97+
// Arrange & Act
98+
var element = Browser.FindElement(By.Id("mailto-link"));
99+
element.Click();
100+
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);
101+
102+
// Assert
103+
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
104+
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
105+
}
106+
107+
[Fact]
108+
public async Task DownloadAction_DoesNotGracefullyDisconnect_TheCurrentCircuit()
109+
{
110+
// Arrange & Act
111+
var element = Browser.FindElement(By.Id("download-link"));
112+
element.Click();
113+
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);
114+
115+
// Assert
116+
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
117+
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
118+
}
119+
120+
[Fact]
121+
public async Task DownloadHref_DoesNotGracefullyDisconnect_TheCurrentCircuit()
122+
{
123+
// Arrange & Act
124+
var element = Browser.FindElement(By.Id("download-href"));
125+
element.Click();
126+
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);
127+
128+
// Assert
129+
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
130+
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
131+
}
132+
94133
private void Log(WriteContext wc)
95134
{
96135
if ((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully") == (wc.LogLevel, wc.EventId.Name))
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@inject NavigationManager navigationManager
2+
3+
<h1>Graceful Termination</h1>
4+
5+
<a href="mailto:test@example.com" id="mailto-link">Send Email</a>
6+
<a href="download" download id="download-href">Download Link</a>
7+
<button @onclick="DownloadFile" id="download-link">Download File</button>
8+
9+
@code {
10+
private void DownloadFile()
11+
{
12+
navigationManager.NavigateTo("/subdir/download", true);
13+
}
14+
}

src/Components/test/testassets/BasicTestApp/Index.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<option value="BasicTestApp.FormsTest.InputFileComponent">Input file</option>
4141
<option value="BasicTestApp.NavigateOnSubmit">Navigate to submit</option>
4242
<option value="BasicTestApp.GlobalizationBindCases">Globalization Bind Cases</option>
43+
<option value="BasicTestApp.GracefulTermination">Graceful Termination</option>
4344
<option value="BasicTestApp.HierarchicalImportsTest.Subdir.ComponentUsingImports">Imports statement</option>
4445
<option value="BasicTestApp.HtmlBlockChildContent">ChildContent HTML Block</option>
4546
<option value="BasicTestApp.HtmlEncodedChildContent">ChildContent HTML Encoded Block</option>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.IO;
3+
using System.Text;
4+
using Microsoft.AspNetCore.Mvc;
5+
6+
namespace Components.TestServer.Controllers
7+
{
8+
public class DownloadController : Controller
9+
{
10+
11+
[HttpGet("~/download")]
12+
public FileStreamResult Download()
13+
{
14+
var buffer = Encoding.UTF8.GetBytes("The quick brown fox jumped over the lazy dog.");
15+
var stream = new MemoryStream(buffer);
16+
17+
var result = new FileStreamResult(stream, "text/plain");
18+
result.FileDownloadName = "test.txt";
19+
return result;
20+
}
21+
}
22+
}

src/Components/test/testassets/TestServer/ServerStartup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
3939
app.UseEndpoints(endpoints =>
4040
{
4141
endpoints.MapBlazorHub();
42+
endpoints.MapControllerRoute("mvc", "{controller}/{action}");
4243
endpoints.MapFallbackToPage("/_ServerHost");
4344
});
4445
});

src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
3535
<!-- This project should not be referenced via the `<Reference>` implementation. -->
3636
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
3737

38-
<PackageConflictManifestFileName>PackageOverrides.txt</PackageConflictManifestFileName>
39-
4038
<!--
4139
We are ignoring MSB3243 warnings since implementation and reference assemblies are versioned differently.
4240
We need both to compose the targeting pack with reference assemblies and xml docs.
@@ -52,7 +50,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant
5250
<!-- Runtime extensions transport paths -->
5351
<RuntimeExtensionsReferenceDirectory>$(PkgMicrosoft_Extensions_Internal_Transport)\ref\$(TargetFramework)\</RuntimeExtensionsReferenceDirectory>
5452

55-
<!-- Platform manifest override metadata. -->
53+
<!-- Package overrides and platform manifest metadata. -->
54+
<PackageOverridesFileName>PackageOverrides.txt</PackageOverridesFileName>
55+
<!-- PackageOverrides.txt is written in GeneratePackageOverrides target unless servicing. -->
56+
<ReferencePackageOverridesPath Condition="'$(IsServicingBuild)' != 'true'">$(TargetDir)$(PackageOverridesFileName)</ReferencePackageOverridesPath>
57+
<ReferencePackageOverridesPath Condition="'$(IsServicingBuild)' == 'true'">$(RepoRoot)eng\$(PackageOverridesFileName)</ReferencePackageOverridesPath>
58+
<!-- PlatformManifest.txt is written in App.Runtime's GenerateSharedFxDepsFile target but not used here when servicing. -->
5659
<ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' != 'true'">$(PlatformManifestOutputPath)</ReferencePlatformManifestPath>
5760
<ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' == 'true'">$(RepoRoot)eng\PlatformManifest.txt</ReferencePlatformManifestPath>
5861
</PropertyGroup>
@@ -84,7 +87,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
8487
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false'">
8588
$(BuildDependsOn);
8689
_ResolveTargetingPackContent;
87-
GeneratePackageConflictManifest;
90+
GeneratePackageOverrides;
8891
IncludeFrameworkListFile;
8992
_BatchCopyToLayoutTargetDir;
9093
_InstallTargetingPackIntoLocalDotNet;
@@ -144,26 +147,22 @@ This package is an internal implementation of the .NET Core SDK and is not meant
144147
Condition="Exists('%(RootDir)%(Directory)%(FileName).xml')" />
145148
<AspNetCoreReferenceDocXml Include="@(_SelectedExtensionsRefAssemblies->'$(RuntimeExtensionsReferenceDirectory)%(FileName).xml')" />
146149
<!-- Grab remaining .xml files from packages -->
147-
<AspNetCoreReferenceDocXml
148-
Include="@(AspNetCoreReferenceAssemblyPath->WithMetadataValue('ExternallyResolved', 'true')->'%(RootDir)%(Directory)%(Filename).xml')"
150+
<AspNetCoreReferenceDocXml
151+
Include="@(AspNetCoreReferenceAssemblyPath->WithMetadataValue('ExternallyResolved', 'true')->'%(RootDir)%(Directory)%(Filename).xml')"
149152
Condition="Exists('%(RootDir)%(Directory)%(Filename).xml')" />
150153

151154
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
152155
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
153-
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(ManifestsPackagePath)" />
156+
<RefPackContent Include="$(ReferencePackageOverridesPath)" PackagePath="$(ManifestsPackagePath)" />
154157
<RefPackContent Include="$(ReferencePlatformManifestPath)" PackagePath="$(ManifestsPackagePath)" />
155158
</ItemGroup>
156159
</Target>
157160

158-
<Target Name="GeneratePackageConflictManifest"
161+
<Target Name="GeneratePackageOverrides"
162+
Condition=" '$(IsServicingBuild)' != 'true' "
159163
DependsOnTargets="_ResolveTargetingPackContent"
160164
Inputs="$(MSBuildAllProjects)"
161-
Outputs="$(TargetDir)$(PackageConflictManifestFileName)">
162-
<PropertyGroup>
163-
<_PinnedNETCoreAppRuntimeVersion>$(MicrosoftNETCoreAppRuntimeVersion)</_PinnedNETCoreAppRuntimeVersion>
164-
<_PinnedNETCoreAppRuntimeVersion
165-
Condition=" '$(IsServicingBuild)' == 'true' ">$(_PinnedNETCoreAppRuntimeVersion.Split('.')[0]).$(_PinnedNETCoreAppRuntimeVersion.Split('.')[1]).0</_PinnedNETCoreAppRuntimeVersion>
166-
</PropertyGroup>
165+
Outputs="$(ReferencePackageOverridesPath">
167166
<ItemGroup>
168167
<!-- Use package version for non-Extensions references. -->
169168
<_AspNetCoreAppPackageOverrides Include="@(AspNetCoreReferenceAssemblyPath->'%(NuGetPackageId)|%(NuGetPackageVersion)')"
@@ -172,16 +171,16 @@ This package is an internal implementation of the .NET Core SDK and is not meant
172171
'%(AspNetCoreReferenceAssemblyPath.NuGetPackageId)' != 'Microsoft.Extensions.Internal.Transport' AND
173172
'%(AspNetCoreReferenceAssemblyPath.NuGetSourceType)' == 'Package' " />
174173

175-
<!-- Use pinned NETCore.App version for Extensions references. -->
176-
<_AspNetCoreAppPackageOverrides Include="@(_SelectedExtensionsRefAssemblies->'%(FileName)|$(_PinnedNETCoreAppRuntimeVersion)')" />
174+
<!-- Use NETCore.App.Runtime version for Extensions references. -->
175+
<_AspNetCoreAppPackageOverrides Include="@(_SelectedExtensionsRefAssemblies->'%(FileName)|$(MicrosoftNETCoreAppRuntimeVersion)')" />
177176

178177
<_AspNetCoreAppPackageOverrides Include="@(AspNetCoreReferenceAssemblyPath->'%(FileName)|$(ReferencePackSharedFxVersion)')"
179178
Condition=" '%(AspNetCoreReferenceAssemblyPath.ReferenceSourceTarget)' == 'ProjectReference' " />
180179
</ItemGroup>
181180

182181
<WriteLinesToFile
183182
Lines="@(_AspNetCoreAppPackageOverrides)"
184-
File="$(TargetDir)$(PackageConflictManifestFileName)"
183+
File="$(ReferencePackageOverridesPath)"
185184
Overwrite="true" />
186185
</Target>
187186

0 commit comments

Comments
 (0)