From 28ee9cb89634bdf52406995d7454d9a4f9b4c265 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Mon, 28 Feb 2022 16:32:15 -0500 Subject: [PATCH 1/2] fix #1783 unrelenting alert when hot reload fails --- .../src/components/core/Reloader.react.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dash/dash-renderer/src/components/core/Reloader.react.js b/dash/dash-renderer/src/components/core/Reloader.react.js index 3bfa9f41eb..5149558d71 100644 --- a/dash/dash-renderer/src/components/core/Reloader.react.js +++ b/dash/dash-renderer/src/components/core/Reloader.react.js @@ -154,15 +154,16 @@ class Reloader extends React.Component { // Backend code changed - can do a soft reload in place dispatch({type: 'RELOAD'}); } - } else if (reloadRequest.status === 500) { + } else if ( + this.state.intervalId !== null && + reloadRequest.status === 500 + ) { if (this._retry > this.state.max_retry) { this.clearInterval(); // Integrate with dev tools ui?! window.alert( - ` - Reloader failed after ${this._retry} times. - Please check your application for errors. - ` + `Hot reloading is disabled after failing ${this._retry} times. ` + + 'Please check your application for errors, then refresh the page.' ); } this._retry++; From 54f3ab3ba7e45d88fa58d73539d679fc3672c16f Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Mon, 28 Feb 2022 16:57:50 -0500 Subject: [PATCH 2/2] changelog for hot reload alert fix --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f66f995b4..ce89761e4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## [Unreleased] + +### Fixed +- [#1953](https://github.com/plotly/dash/pull/1953) Fix bug [#1783](https://github.com/plotly/dash/issues/1783) in which a failed hot reloader blocks the UI with alerts. + ## [2.2.0] - 2022-02-18 ### Added