From feed18ed0de9f9de6fab160226c203dc2e9061a0 Mon Sep 17 00:00:00 2001 From: pdmarf <135653545+pdmarf@users.noreply.github.com> Date: Wed, 2 Sep 2026 11:46:08 +0100 Subject: [PATCH] v1.0.50: add diagnostic logging for the update-refresh flow No functional change. Adds streamDeck.logger.info() calls at onPropertyInspectorDidAppear, sendProjectsToPI(), and onSendToPlugin entry, plus a small on-panel debug trail (property-inspector.html) that timestamps $PI.onConnected firings, button clicks, poll sends, and received payloads. v1.0.49's panel-polling fix didn't visibly work in testing and produced no status text at all on the second attempt -- need to see the actual event sequence rather than guess again. Remove once the refresh flow is confirmed working. --- com.pdma.notion-timer.sdPlugin/bin/plugin.js | 9 +++++++-- .../bin/plugin.js.sig | 2 +- .../ui/property-inspector.html | 14 ++++++++++++++ notion-timer.streamDeckPlugin | Bin 100057 -> 100451 bytes src/plugin.ts | 9 +++++++-- version.json | 2 +- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index e8760e2..fe7ddc7 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.49"; +var CURRENT_VERSION = "1.0.50"; 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= @@ -6543,10 +6543,12 @@ function setRunningEntry(entryId, actionId) { plugin_default.settings.getGlobalSettings().then((stored) => plugin_default.settings.setGlobalSettings({ ...stored, runningEntryId: entryId, runningActionId: actionId })).catch((err) => plugin_default.logger.error("Failed to persist running state:", err)); } async function sendProjectsToPI(tokenOverride) { + plugin_default.logger.info(`[diag] sendProjectsToPI called, version=${CURRENT_VERSION}, hasToken=${!!tokenOverride}`); try { const global = await getGlobal(); const token = tokenOverride ?? global.notionToken; if (!token) { + plugin_default.logger.info("[diag] sendProjectsToPI: no token, sending error payload"); await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: [], error: "Enter your Notion API token above.", version: CURRENT_VERSION }); return; } @@ -6558,6 +6560,7 @@ async function sendProjectsToPI(tokenOverride) { }) ]); await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: projects, users: usersResult, version: CURRENT_VERSION }); + plugin_default.logger.info(`[diag] sendProjectsToPI: sent projects payload, version=${CURRENT_VERSION}`); } catch (err) { plugin_default.logger.error("Failed to fetch projects:", err); await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: [], error: String(err), version: CURRENT_VERSION }); @@ -6635,7 +6638,8 @@ var TimerToggle = class extends SingletonAction { await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]); } } - async onPropertyInspectorDidAppear(_ev) { + async onPropertyInspectorDidAppear(ev) { + plugin_default.logger.info(`[diag] onPropertyInspectorDidAppear fired for ${ev.action.id}, version=${CURRENT_VERSION}`); await sendProjectsToPI(); } async onKeyDown(ev) { @@ -6721,6 +6725,7 @@ TimerToggle = __decorateClass([ var timerAction = new TimerToggle(); plugin_default.actions.registerAction(timerAction); plugin_default.ui.onSendToPlugin(async (ev) => { + plugin_default.logger.info(`[diag] onSendToPlugin received event=${ev.payload.event}, version=${CURRENT_VERSION}`); if (ev.payload.event === "saveSettings" && ev.payload.settings) { await ev.action.setSettings(ev.payload.settings); const title = buttonTitle(ev.payload.settings.projectName || ""); diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index 4a52926..f077a92 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1 +1 @@ -sõ¨ÒâËÒŒ›ÍS«ÓúÌuá�¯Is5n²›6äùÑJåë¸ZÏÅh?®†²ª¹È…˜©LJV½?1 \ No newline at end of file +u…o%]¹8®ú~/†l�bßϨRŸ1‚ôŽÜ®¸u»†Í%]çâ4Cñ®¥Ri1ü¢Â×05@KfíÙ#X \ No newline at end of file diff --git a/com.pdma.notion-timer.sdPlugin/ui/property-inspector.html b/com.pdma.notion-timer.sdPlugin/ui/property-inspector.html index 5372e0a..443339a 100644 --- a/com.pdma.notion-timer.sdPlugin/ui/property-inspector.html +++ b/com.pdma.notion-timer.sdPlugin/ui/property-inspector.html @@ -147,6 +147,7 @@
+ @@ -176,6 +177,15 @@ el.className = cls || ""; } + // TEMP diagnostic trail — remove once the update-refresh flow is confirmed working. + var debugLines = []; + function debugLog(msg) { + var t = new Date().toISOString().slice(11, 19); + debugLines.push(t + " " + msg); + if (debugLines.length > 8) debugLines.shift(); + document.getElementById("debugText").textContent = debugLines.join("\n"); + } + // The plugin process restarts after an update, and a freshly-restarted // process has no way to push to an already-open panel (Stream Deck only // tells a plugin a panel is visible via a live didAppear/onSendToPlugin @@ -186,6 +196,7 @@ var token = document.getElementById("notionToken").value.trim(); [1500, 3500, 6000, 9000].forEach(function(delay) { setTimeout(function() { + debugLog("poll: sending refreshProjects (+" + delay + "ms)"); $PI.sendToPlugin({ event: "refreshProjects", token: token }); }, delay); }); @@ -269,6 +280,7 @@ } $PI.onConnected(function(jsn) { + debugLog("$PI.onConnected fired (panel loaded/reloaded)"); currentSettings = jsn.actionInfo.payload.settings || {}; $PI.getSettings(); $PI.getGlobalSettings(); @@ -277,6 +289,7 @@ document.getElementById("notionToken").addEventListener("input", scheduleCredSave); document.getElementById("userId").addEventListener("change", saveCredentials); document.getElementById("updateBtn").addEventListener("click", function() { + debugLog("Check for Updates clicked"); document.getElementById("updateStatus").textContent = ""; $PI.sendToPlugin({ event: "checkForUpdates" }); pollForVersionRefresh(); @@ -319,6 +332,7 @@ $PI.onSendToPropertyInspector(ACTION_UUID, function(jsn) { var payload = jsn.payload; + debugLog("received: " + payload.event + (payload.version ? " v" + payload.version : "")); if (payload.event === "updateStatus") { document.getElementById("updateStatus").textContent = payload.message; } diff --git a/notion-timer.streamDeckPlugin b/notion-timer.streamDeckPlugin index 0cb89ec2aeb8b929845b2921ab8d4ced0c815757..97d676fac3bba7b5f59a12d20ddbefab9b0c2484 100644 GIT binary patch delta 45948 zcmV)cK&ZdjjRxb829RR{qFs??IR-HPmuf-&mob6?6O$h12(iDbClR7uB3%Vcw=t*; z005UP0023Yu?HoSpeP)FF#eZnF#eZnb$AN^0R;5{000CO0002RTHS8j$Q8cNQ%sn4 zBXvbej_s^1%U&c-wl$DsjkQx?kp_z~Ig%!(NR~6Sqb3IS4SG}TBlNyEd)24Olk}YV zA!n#RC+kHMz@|87&N=g)|B*-cpM8IP{^RL$GL^IR=-vo_k(6eClf!^z0lr`~Il4#4 zXvQQZ@syT=$-|(M<8Uuf3qsCQhEIh2iF_az`TJ1tfADNFgy%A0WeBeh$c&Z~o(;+1 zfD|-I)H*!hsErqSGAAF@BO&8Fli`@ocsd`FkQPPCLNOPT&3fc%%CpOtG(J*vXGIbtR||m6H%K!!+B^
zov8UxA&7TM#1$i|QU;|7gpT~~UH|1lH*9M(%K3Tbh7PU%m`zKM5iuEhwCR(@wyp1-
zN0=tDf9 &R
zOd8}Pov)Iz-aJ;<$+2SiRM{YDUEz|=_j^~k7Vrlm8UDc4pC23?v=kvs@%f;olh(A3
z9R0#RCsV@S^xx1S|BZd}-`FkegZ*Bw$8R?nBoce36p6S5JEN&7gLs~ugNW+zT$941
zHGe9bonj)d3AOZEiC3G|BT0`4-d@qh3NAI4+37h4C}>|Lygs}%xDs93RUDUdzq-bO
zG)(}wcWu{t6sv_c31|VNSWSXeyefNPksmw;4-fZ&NshXoAE;VR_o^uJ=Crcry)wso
z`k_frwxdwBwkl{d`C~p(o#oR((Ql@lrhi@7)4y;lE~lm*7N_b6IK2m0FNWEQdssfB
zQggmUP67e5p)AT2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