From b8ec24b9de5bd74cc45cf1e305fa14527e7db270 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Wed, 14 Aug 2024 08:08:47 +0200 Subject: [PATCH] Add comment to msg unrolling --- extra/Lamdera/Injection.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extra/Lamdera/Injection.hs b/extra/Lamdera/Injection.hs index 991ce1c4..d6fa4ed8 100644 --- a/extra/Lamdera/Injection.hs +++ b/extra/Lamdera/Injection.hs @@ -583,6 +583,12 @@ injections outputType = { if (buriedTimestamp !== null) { const elapsed = Date.now() - buriedTimestamp; + // This tries to turn `HomePageMsg (WeatherWidgetMsg (WeatherReportReceived WeatherReport))` + // into `"HomePageMsg WeatherWidgetMsg WeatherReportReceived"`. + // The idea is that if the timeout for forwarding messages isn't enough, we want to know what + // message somebody used that took even longer, but without reporting the entire msg. + // Note that in `--optimize` mode, the above string would become something like `"1 3 6"`, + // but it's better than nothing. let msgName = '(unknown message)'; if (msg.$) { msgName = msg.$;