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:
@@ -147,6 +147,7 @@
|
||||
<p id="versionText"></p>
|
||||
<button id="updateBtn">Check for Updates</button>
|
||||
<p id="updateStatus"></p>
|
||||
<p id="debugText" style="font-size:9px;color:#555;text-align:center;margin-top:4px;white-space:pre-line;"></p>
|
||||
|
||||
<script src="libs/constants.js"></script>
|
||||
<script src="libs/prototypes.js"></script>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user