From 2e2f2553ac8042feaa52b5d736b36e80190d32e9 Mon Sep 17 00:00:00 2001 From: pdmarf <135653545+pdmarf@users.noreply.github.com> Date: Tue, 25 Aug 2026 16:34:38 +0100 Subject: [PATCH] v1.0.44: clear tracked running state immediately after stopping old timer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found while testing v1.0.43's icon self-heal: when switching from one running timer to another, the old Notion entry was stopped but memRunningActionId/EntryId weren't cleared until AFTER the new startTimer call resolved. During that gap, a blocked press on the just-stopped button read the stale (not-yet-cleared) tracked id and self-healed itself back to a wrongly-'running' green — reinforcing the exact staleness the self-heal was meant to fix. Now cleared to null the moment the old timer is actually stopped. --- com.pdma.notion-timer.sdPlugin/bin/plugin.js | 3 ++- com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig | 4 +--- src/plugin.ts | 3 ++- version.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index d1f5d27..8f06595 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js @@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) { } // src/plugin.ts -var CURRENT_VERSION = "1.0.43"; +var CURRENT_VERSION = "1.0.44"; var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild"; var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -6683,6 +6683,7 @@ var TimerToggle = class extends SingletonAction { } else { if (memRunningEntryId) { await stopTimer(global.notionToken, memRunningEntryId); + setRunningEntry(null, null); this.clearElapsedCheck(); } const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId); diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index d73511c..7f3e219 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1,3 +1 @@ -íü„«ÚƒJºh^©A׊[ÈÍ -Ìg»Jµmã -SÙ¹mš']ï´y�j$¬<ÎÇÙÃ5ef «?eó=™y– \ No newline at end of file +ß߬4•íûñ"ÆZÖXs¨2²žUîg¤¶Ù¼~œ{z« 6í§šLéäµ¢P>Øü÷p¨ÇKe̯ \ No newline at end of file diff --git a/src/plugin.ts b/src/plugin.ts index 29a17e4..046a2b8 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,4 +1,4 @@ -const CURRENT_VERSION = "1.0.43"; +const CURRENT_VERSION = "1.0.44"; const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild"; const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -290,6 +290,7 @@ class TimerToggle extends SingletonAction { } else { if (memRunningEntryId) { await stopTimer(global.notionToken, memRunningEntryId); + setRunningEntry(null, null); this.clearElapsedCheck(); } const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId); diff --git a/version.json b/version.json index 431bac7..471547d 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{ "version": "1.0.43" } +{ "version": "1.0.44" }