From f59c12a9293046233382008dc9cafb50e5ad133a Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Fri, 6 Mar 2026 23:59:56 -0500 Subject: [PATCH] fix(race): log initial countdown on start (#356) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem Starting a race on a contest more than 1 hour away showed no feedback — `should_notify` only fires at 15-minute intervals, so the first tick produced no message and the UI appeared frozen during the contest list fetch. ## Solution Log the initial countdown immediately after the race timer is set up, before the first `should_notify` tick fires. --- lua/cp/race.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/cp/race.lua b/lua/cp/race.lua index 1728506..8350806 100644 --- a/lua/cp/race.lua +++ b/lua/cp/race.lua @@ -209,6 +209,15 @@ function M.start(platform, contest_id, language) race_state.last_refetch = os.time() race_state.token = token + logger.log( + ('%s race "%s" starts in %s'):format( + display, + race_state.contest_name, + format_countdown(remaining) + ), + { level = vim.log.levels.INFO, override = true } + ) + local timer = vim.uv.new_timer() race_state.timer = timer timer:start(