From ec1529fa6bf6f44515e9ac4dae644ecef63cdf4c Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 2 Jun 2026 10:44:09 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20propagation=20overlay=20broken=20by=20io?= =?UTF-8?q?list=E2=86=92binary=20crash=20in=20encode=5Fbinary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two regressions from the recent performance commits: 1. ScoresController.encode_binary/1 (9cce257d): Enum.reduce produces iolists, but <> requires actual binaries. Caused HTTP 500 on every /scores/cells request when score files exist on disk, making the entire propagation heatmap overlay invisible. 2. ScoreCache.valid_times/1 (15f4175c): Pipe syntax feeds @table as the first argument to :ets.foldl/3, creating a 4-argument call that crashes at runtime. --- lib/microwaveprop/propagation/score_cache.ex | 3 +-- lib/microwaveprop_web/controllers/scores_controller.ex | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/microwaveprop/propagation/score_cache.ex b/lib/microwaveprop/propagation/score_cache.ex index cfdd5fdc..553e8c85 100644 --- a/lib/microwaveprop/propagation/score_cache.ex +++ b/lib/microwaveprop/propagation/score_cache.ex @@ -149,8 +149,7 @@ defmodule Microwaveprop.Propagation.ScoreCache do @doc "Returns the sorted list of valid_times cached for `band_mhz`." @spec valid_times(non_neg_integer()) :: [DateTime.t()] def valid_times(band_mhz) do - @table - |> :ets.foldl( + :ets.foldl( fn {{^band_mhz, vt}, _}, acc -> [vt | acc] _, acc -> acc diff --git a/lib/microwaveprop_web/controllers/scores_controller.ex b/lib/microwaveprop_web/controllers/scores_controller.ex index 09095108..070a2d82 100644 --- a/lib/microwaveprop_web/controllers/scores_controller.ex +++ b/lib/microwaveprop_web/controllers/scores_controller.ex @@ -110,7 +110,8 @@ defmodule MicrowavepropWeb.ScoresController do [<> | scs_acc]} end) - <> + <> end defp clamp_score(s) when is_integer(s) and s < 0, do: 0