From 30d03a7e686f1c44cdf6e228168019b235882ca9 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Thu, 20 Oct 2022 09:19:39 +0200 Subject: [PATCH] FIxed race condition in dev server that causes reload to not work Fixes #1513 --- exe/IHP/IDE/DevServer.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exe/IHP/IDE/DevServer.hs b/exe/IHP/IDE/DevServer.hs index 0f21bd486..83cc3e50f 100644 --- a/exe/IHP/IDE/DevServer.hs +++ b/exe/IHP/IDE/DevServer.hs @@ -151,7 +151,11 @@ handleAction state AssetChanged = do handleAction state@(AppState { appGHCIState, statusServerState }) HaskellFileChanged = do case appGHCIState of - AppGHCIModulesLoaded { .. } -> sendGhciCommand process ":r" + AppGHCIModulesLoaded { .. } -> do + -- The app might already have been triggered + -- but the the "Server started" message might not have been received yet + sendGhciCommand process "ClassyPrelude.uninterruptibleCancel app" + sendGhciCommand process ":r" RunningAppGHCI { .. } -> do sendGhciCommand process "ClassyPrelude.uninterruptibleCancel app" sendGhciCommand process ":r"