From fce84180916dec72cee64b04338ec50dcee02adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Rozto=C4=8Dil?= Date: Mon, 10 Nov 2025 18:50:18 +0100 Subject: [PATCH 1/4] Add page reload when resuming Blazor circuit fails --- .../src/Platform/Circuits/DefaultReconnectDisplay.ts | 7 ++++--- .../Components/Layout/ReconnectModal.razor.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts index a14aa03363c7..1c976ea82b99 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts @@ -133,9 +133,10 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { this.status.innerHTML = 'Failed to rejoin.
Please retry or reload the page.'; this.document.addEventListener('visibilitychange', this.retryWhenDocumentBecomesVisible); } else { - this.status.innerHTML = 'Failed to resume the session.
Please reload the page.'; - this.resumeButton.style.display = 'none'; - this.reloadButton.style.display = 'none'; + // Resuming circuit failed, last resort is to reload the page. + // This enables automatic reconnection (with empty state) when the server is restarted, + // e.g. during local development. + location.reload(); } } diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js index e52a190bacbb..0465d72dff7c 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js @@ -15,7 +15,7 @@ function handleReconnectStateChanged(event) { reconnectModal.close(); } else if (event.detail.state === "failed") { document.addEventListener("visibilitychange", retryWhenDocumentBecomesVisible); - } else if (event.detail.state === "rejected") { + } else if (event.detail.state === "rejected" || event.detail.state === "resume-failed") { location.reload(); } } From 04ea8f0ba9221181cf7d51654249d7df9f4ef460 Mon Sep 17 00:00:00 2001 From: Ondrej Roztocil Date: Wed, 12 Nov 2025 15:35:28 +0100 Subject: [PATCH 2/4] Improve readability of DefaultReconnectDisplay --- .../Circuits/DefaultReconnectDisplay.ts | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts index 1c976ea82b99..dfcf68aa2622 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts @@ -26,13 +26,13 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { rejoiningAnimation: HTMLDivElement; - reloadButton: HTMLButtonElement; + retryButton: HTMLButtonElement; resumeButton: HTMLButtonElement; status: HTMLParagraphElement; - reconnect = true; + operation: ReconnectDisplayUpdateOptions['type'] = 'reconnect'; remote = false; @@ -65,10 +65,10 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { this.status = document.createElement('p'); this.status.innerHTML = ''; - this.reloadButton = document.createElement('button'); - this.reloadButton.style.display = 'none'; - this.reloadButton.innerHTML = 'Retry'; - this.reloadButton.addEventListener('click', this.retry.bind(this)); + this.retryButton = document.createElement('button'); + this.retryButton.style.display = 'none'; + this.retryButton.innerHTML = 'Retry'; + this.retryButton.addEventListener('click', this.retry.bind(this)); this.resumeButton = document.createElement('button'); this.resumeButton.style.display = 'none'; @@ -77,7 +77,7 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { this.dialog.appendChild(this.rejoiningAnimation); this.dialog.appendChild(this.status); - this.dialog.appendChild(this.reloadButton); + this.dialog.appendChild(this.retryButton); this.dialog.appendChild(this.resumeButton); this.overlay.appendChild(this.dialog); @@ -94,9 +94,9 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { this.document.body.appendChild(this.host); } - this.reconnect = options?.type === 'reconnect'; + this.operation = options?.type ?? 'reconnect'; - this.reloadButton.style.display = 'none'; + this.retryButton.style.display = 'none'; this.rejoiningAnimation.style.display = 'block'; this.status.innerHTML = 'Rejoining the server...'; this.host.style.display = 'block'; @@ -104,8 +104,13 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { } update(options: ReconnectDisplayUpdateOptions): void { - this.reconnect = options.type === 'reconnect'; - if (this.reconnect) { + this.operation = options.type; + if (this.operation === 'pause') { + this.retryButton.style.display = 'none'; + this.rejoiningAnimation.style.display = 'none'; + this.status.innerHTML = 'The session has been paused by the server.'; + this.resumeButton.style.display = 'block'; + } else { const { currentAttempt, secondsToNextAttempt } = options as ReconnectOptions; if (currentAttempt === 1 || secondsToNextAttempt === 0) { this.status.innerHTML = 'Rejoining the server...'; @@ -113,11 +118,6 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { const unitText = secondsToNextAttempt === 1 ? 'second' : 'seconds'; this.status.innerHTML = `Rejoin failed... trying again in ${secondsToNextAttempt} ${unitText}`; } - } else { - this.reloadButton.style.display = 'none'; - this.rejoiningAnimation.style.display = 'none'; - this.status.innerHTML = 'The session has been paused by the server.'; - this.resumeButton.style.display = 'block'; } } @@ -128,15 +128,15 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { failed(): void { this.rejoiningAnimation.style.display = 'none'; - if (this.reconnect) { - this.reloadButton.style.display = 'block'; + if (this.operation === 'pause') { + // The client expected to be able to resume the circuit and it failed. + // This typically happens when the server has been restarted and the circuit state is lost. + // This is effectively the same as the circuit being rejected during reconnect. + this.rejected(); + } else { + this.retryButton.style.display = 'block'; this.status.innerHTML = 'Failed to rejoin.
Please retry or reload the page.'; this.document.addEventListener('visibilitychange', this.retryWhenDocumentBecomesVisible); - } else { - // Resuming circuit failed, last resort is to reload the page. - // This enables automatic reconnection (with empty state) when the server is restarted, - // e.g. during local development. - location.reload(); } } @@ -161,7 +161,7 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { this.update({ type: 'pause', remote: this.remote }); const resumeSuccessful = await Blazor.resumeCircuit!(); if (!resumeSuccessful) { - this.rejected(); + this.failed(); } } } catch (err: unknown) { From a864856f05df1adf2e5647ad47be8faa3b049bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Rozto=C4=8Dil?= Date: Thu, 13 Nov 2025 16:19:34 +0100 Subject: [PATCH 3/4] Reload page automatically only when resume fails after non-graceful pause --- .../Circuits/DefaultReconnectDisplay.ts | 21 ++++++++++++++----- .../Circuits/DefaultReconnectionHandler.ts | 4 +++- .../src/Platform/Circuits/ReconnectDisplay.ts | 3 ++- .../Circuits/ReconnectStateChangedEvent.ts | 1 + .../Platform/Circuits/UserSpecifiedDisplay.ts | 3 ++- .../Components/Layout/ReconnectModal.razor | 8 +++---- .../Components/Layout/ReconnectModal.razor.js | 2 +- 7 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts index dfcf68aa2622..18408cc79797 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts @@ -36,6 +36,8 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { remote = false; + graceful = false; + retryWhenDocumentBecomesVisible: () => void; constructor(dialogId: string, private readonly document: Document, private readonly logger: Logger) { @@ -95,6 +97,7 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { } this.operation = options?.type ?? 'reconnect'; + this.graceful = (options?.type === 'pause') ? options.graceful : false; this.retryButton.style.display = 'none'; this.rejoiningAnimation.style.display = 'block'; @@ -105,6 +108,8 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { update(options: ReconnectDisplayUpdateOptions): void { this.operation = options.type; + this.graceful = (options.type === 'pause') ? options.graceful : false; + if (this.operation === 'pause') { this.retryButton.style.display = 'none'; this.rejoiningAnimation.style.display = 'none'; @@ -129,10 +134,16 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { failed(): void { this.rejoiningAnimation.style.display = 'none'; if (this.operation === 'pause') { - // The client expected to be able to resume the circuit and it failed. - // This typically happens when the server has been restarted and the circuit state is lost. - // This is effectively the same as the circuit being rejected during reconnect. - this.rejected(); + if (this.graceful) { + // Circuit failed to resume after a graceful (client-requested) pause. + // We show a retry UI to allow the user to try to continue without losing the state. + this.resumeButton.style.display = 'block'; + this.status.innerHTML = 'Failed to resume.
Please retry or reload the page.'; + } else { + // Circuit failed to resume after an ungraceful pause (e.g., server restart). + // We treat this as non-recoverable rejection. + this.rejected(); + } } else { this.retryButton.style.display = 'block'; this.status.innerHTML = 'Failed to rejoin.
Please retry or reload the page.'; @@ -158,7 +169,7 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { const successful = await Blazor.reconnect!(); if (!successful) { // Try to resume the circuit if the reconnect failed - this.update({ type: 'pause', remote: this.remote }); + this.update({ type: 'pause', remote: this.remote, graceful: this.graceful }); const resumeSuccessful = await Blazor.resumeCircuit!(); if (!resumeSuccessful) { this.failed(); diff --git a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts index 31528e850a41..35e4efe0145c 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts @@ -75,6 +75,7 @@ class ReconnectionProcess { const displayOptions: ReconnectDisplayUpdateOptions = { type: isGracefulPause ? 'pause' : 'reconnect', remote: this.isRemote, + graceful: !!isGracefulPause, currentAttempt: 0, secondsToNextAttempt: 0, }; @@ -85,6 +86,7 @@ class ReconnectionProcess { this.reconnectDisplay.update({ type: 'pause', remote: this.isRemote, + graceful: true, }); } } @@ -126,7 +128,7 @@ class ReconnectionProcess { if (!result) { // Try to resume the circuit if the reconnect failed // If the server responded and refused to reconnect, stop auto-retrying. - this.reconnectDisplay.update({ type: 'pause', remote: true }); + this.reconnectDisplay.update({ type: 'pause', remote: true, graceful: false }); const resumeResult = await this.resumeCallback(); if (resumeResult) { return; diff --git a/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts index efa09b259cca..9c5ca2870d29 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts @@ -13,7 +13,8 @@ export type ReconnectDisplayUpdateOptions = ReconnectOptions | PauseOptions; export type PauseOptions = { type: 'pause', - remote: boolean + remote: boolean, + graceful: boolean }; export type ReconnectOptions = { diff --git a/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts b/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts index 986886098272..751a0f52d23a 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts @@ -3,4 +3,5 @@ export interface ReconnectStateChangedEvent { currentAttempt?: number; secondsToNextAttempt?: number; remote?: boolean; + graceful?: boolean; } diff --git a/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts index 01106b9a6665..a4e9307d810e 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts @@ -71,9 +71,10 @@ export class UserSpecifiedDisplay implements ReconnectDisplay { } if (options.type === 'pause') { const remote = options.remote; + const graceful = options.graceful; this.dialog.classList.remove(UserSpecifiedDisplay.ShowClassName, UserSpecifiedDisplay.RetryingClassName); this.dialog.classList.add(UserSpecifiedDisplay.PausedClassName); - this.dispatchReconnectStateChangedEvent({ state: 'paused', remote: remote }); + this.dispatchReconnectStateChangedEvent({ state: 'paused', remote: remote, graceful: graceful }); } } diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor index a85217a1132b..44f63561f43a 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor @@ -25,11 +25,11 @@

The session has been paused by the server.

-

- Failed to resume the session.
Please reload the page. + Failed to resume the session.
Please retry or reload the page.

+ diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js index 0465d72dff7c..78a29c469dde 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js @@ -15,7 +15,7 @@ function handleReconnectStateChanged(event) { reconnectModal.close(); } else if (event.detail.state === "failed") { document.addEventListener("visibilitychange", retryWhenDocumentBecomesVisible); - } else if (event.detail.state === "rejected" || event.detail.state === "resume-failed") { + } else if (event.detail.state === "rejected" || (event.detail.state === "resume-failed" && !!event.detail.graceful)) { location.reload(); } } From 9cdfa5afb1c6e285c2ba4ef3aa68ea1f42079c36 Mon Sep 17 00:00:00 2001 From: Ondrej Roztocil Date: Mon, 17 Nov 2025 20:34:02 +0100 Subject: [PATCH 4/4] Use 'remote' flag to distinguish graceful and ungraceful circuit pauses --- .../Circuits/DefaultReconnectDisplay.ts | 20 +++++++++---------- .../Circuits/DefaultReconnectionHandler.ts | 4 +--- .../src/Platform/Circuits/ReconnectDisplay.ts | 3 +-- .../Circuits/ReconnectStateChangedEvent.ts | 1 - .../Platform/Circuits/UserSpecifiedDisplay.ts | 3 +-- .../Components/Layout/ReconnectModal.razor.js | 2 +- 6 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts index 18408cc79797..153b39a44cbc 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts @@ -36,8 +36,6 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { remote = false; - graceful = false; - retryWhenDocumentBecomesVisible: () => void; constructor(dialogId: string, private readonly document: Document, private readonly logger: Logger) { @@ -97,7 +95,7 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { } this.operation = options?.type ?? 'reconnect'; - this.graceful = (options?.type === 'pause') ? options.graceful : false; + this.remote = options?.type === 'pause' ? options?.remote : false; this.retryButton.style.display = 'none'; this.rejoiningAnimation.style.display = 'block'; @@ -108,7 +106,7 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { update(options: ReconnectDisplayUpdateOptions): void { this.operation = options.type; - this.graceful = (options.type === 'pause') ? options.graceful : false; + this.remote = options?.type === 'pause' ? options?.remote : false; if (this.operation === 'pause') { this.retryButton.style.display = 'none'; @@ -134,17 +132,19 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { failed(): void { this.rejoiningAnimation.style.display = 'none'; if (this.operation === 'pause') { - if (this.graceful) { + // Failed to resume from pause. + if (this.remote) { + // Circuit failed to resume after an ungraceful pause (e.g., server restart). + // We treat this as non-recoverable rejection. + this.rejected(); + } else { // Circuit failed to resume after a graceful (client-requested) pause. // We show a retry UI to allow the user to try to continue without losing the state. this.resumeButton.style.display = 'block'; this.status.innerHTML = 'Failed to resume.
Please retry or reload the page.'; - } else { - // Circuit failed to resume after an ungraceful pause (e.g., server restart). - // We treat this as non-recoverable rejection. - this.rejected(); } } else { + // Failed to reconnect. this.retryButton.style.display = 'block'; this.status.innerHTML = 'Failed to rejoin.
Please retry or reload the page.'; this.document.addEventListener('visibilitychange', this.retryWhenDocumentBecomesVisible); @@ -169,7 +169,7 @@ export class DefaultReconnectDisplay implements ReconnectDisplay { const successful = await Blazor.reconnect!(); if (!successful) { // Try to resume the circuit if the reconnect failed - this.update({ type: 'pause', remote: this.remote, graceful: this.graceful }); + this.update({ type: 'pause', remote: this.remote }); const resumeSuccessful = await Blazor.resumeCircuit!(); if (!resumeSuccessful) { this.failed(); diff --git a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts index 35e4efe0145c..31528e850a41 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts @@ -75,7 +75,6 @@ class ReconnectionProcess { const displayOptions: ReconnectDisplayUpdateOptions = { type: isGracefulPause ? 'pause' : 'reconnect', remote: this.isRemote, - graceful: !!isGracefulPause, currentAttempt: 0, secondsToNextAttempt: 0, }; @@ -86,7 +85,6 @@ class ReconnectionProcess { this.reconnectDisplay.update({ type: 'pause', remote: this.isRemote, - graceful: true, }); } } @@ -128,7 +126,7 @@ class ReconnectionProcess { if (!result) { // Try to resume the circuit if the reconnect failed // If the server responded and refused to reconnect, stop auto-retrying. - this.reconnectDisplay.update({ type: 'pause', remote: true, graceful: false }); + this.reconnectDisplay.update({ type: 'pause', remote: true }); const resumeResult = await this.resumeCallback(); if (resumeResult) { return; diff --git a/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts index 9c5ca2870d29..efa09b259cca 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/ReconnectDisplay.ts @@ -13,8 +13,7 @@ export type ReconnectDisplayUpdateOptions = ReconnectOptions | PauseOptions; export type PauseOptions = { type: 'pause', - remote: boolean, - graceful: boolean + remote: boolean }; export type ReconnectOptions = { diff --git a/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts b/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts index 751a0f52d23a..986886098272 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/ReconnectStateChangedEvent.ts @@ -3,5 +3,4 @@ export interface ReconnectStateChangedEvent { currentAttempt?: number; secondsToNextAttempt?: number; remote?: boolean; - graceful?: boolean; } diff --git a/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts b/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts index a4e9307d810e..01106b9a6665 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts @@ -71,10 +71,9 @@ export class UserSpecifiedDisplay implements ReconnectDisplay { } if (options.type === 'pause') { const remote = options.remote; - const graceful = options.graceful; this.dialog.classList.remove(UserSpecifiedDisplay.ShowClassName, UserSpecifiedDisplay.RetryingClassName); this.dialog.classList.add(UserSpecifiedDisplay.PausedClassName); - this.dispatchReconnectStateChangedEvent({ state: 'paused', remote: remote, graceful: graceful }); + this.dispatchReconnectStateChangedEvent({ state: 'paused', remote: remote }); } } diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js index 78a29c469dde..8e4dee798486 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js @@ -15,7 +15,7 @@ function handleReconnectStateChanged(event) { reconnectModal.close(); } else if (event.detail.state === "failed") { document.addEventListener("visibilitychange", retryWhenDocumentBecomesVisible); - } else if (event.detail.state === "rejected" || (event.detail.state === "resume-failed" && !!event.detail.graceful)) { + } else if (event.detail.state === "rejected" || (event.detail.state === "resume-failed" && event.detail.remote)) { location.reload(); } }