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.
This commit is contained in:
pdmarf
2026-09-02 11:46:08 +01:00
parent acf4f98d6b
commit feed18ed0d
6 changed files with 30 additions and 6 deletions
+7 -2
View File
@@ -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 || "");
@@ -1 +1 @@
sѕЈвтЫв��ЭSЋгњЬuс�ЏIs5nВ�6фљбJхыИZЯХh?Ў�ВЊЙШ��ЉLJVН?1
u…o%]¹8®ú~/†l�bßϨRŸ1‚ôŽÜ®¸u»†Í%]çâ4Cñ®¥Ri1ü¢Â×05@KfíÙ#X