From 22fd4b079dcf02a72fbd26c9d6733b5ec250ea53 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 26 Mar 2024 07:10:05 +0100 Subject: fix: fix log Previously, we tracked re-opening of issues by advancing the commit hash for scrambles that do not witness an issue. Advancing the commit hash for scrambles not witnessing an issue is obviously incorrect. To see that, consider a top/earlier commit that creates a new file with an issue in it. None of the bottom/later scrambles witness the issue. Hence, it would have been logged as being created in the bottom-most/latest commit instead of the top-most/earliest commit. --- app/History/Plan.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/History/Plan.hs') diff --git a/app/History/Plan.hs b/app/History/Plan.hs index 3dec391..d7984c6 100644 --- a/app/History/Plan.hs +++ b/app/History/Plan.hs @@ -41,6 +41,8 @@ class Planable output where protoOf :: Proxy output -> Id output -> IO (Proto output) assume :: Proto output -> output propagate :: [Id output] -> output -> Proto output -> output + postprocess :: [Id output] -> output -> output + postprocess _ = id data Plan output = Plan (NE.NonEmpty (Id output)) [Task output] @@ -102,7 +104,7 @@ realise plan@(Plan ids tasks) = do output <- atomically $ do maybe retry pure . M.lookup id . (.outputs) =<< readTVar stateT killThread tid - pure output + pure (postprocess (NE.toList ids) output) step :: (Ord (Id output), Planable output) => -- cgit v1.2.3