v1.0.44: clear tracked running state immediately after stopping old timer

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.
This commit is contained in:
pdmarf
2026-08-25 16:34:38 +01:00
parent 45201bc376
commit 2e2f2553ac
4 changed files with 6 additions and 6 deletions
+2 -1
View File
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
} }
// src/plugin.ts // 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 GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -6683,6 +6683,7 @@ var TimerToggle = class extends SingletonAction {
} else { } else {
if (memRunningEntryId) { if (memRunningEntryId) {
await stopTimer(global.notionToken, memRunningEntryId); await stopTimer(global.notionToken, memRunningEntryId);
setRunningEntry(null, null);
this.clearElapsedCheck(); this.clearElapsedCheck();
} }
const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId); const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId);
@@ -1,3 +1 @@
íü„«ÚƒJºh^©A׊[ÈÍ ��¬4•ם�ס"ֶZײXs¨2²�Uמg₪¶�¼~�{z« 6ם§�Lיהµ¢P>״�קp¨ַKeּ¯
Ìg»Jµmã
SÙ¹mš']ï´y�j$¬<ÎÇÙÃ5ef «?eó=™y–
+2 -1
View File
@@ -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 GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -290,6 +290,7 @@ class TimerToggle extends SingletonAction<TimerSettings> {
} else { } else {
if (memRunningEntryId) { if (memRunningEntryId) {
await stopTimer(global.notionToken, memRunningEntryId); await stopTimer(global.notionToken, memRunningEntryId);
setRunningEntry(null, null);
this.clearElapsedCheck(); this.clearElapsedCheck();
} }
const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId); const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId);
+1 -1
View File
@@ -1 +1 @@
{ "version": "1.0.43" } { "version": "1.0.44" }