v1.0.58: add logging around the update-check so silent failures are visible
This commit is contained in:
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
|
||||
}
|
||||
|
||||
// src/plugin.ts
|
||||
var CURRENT_VERSION = "1.0.57";
|
||||
var CURRENT_VERSION = "1.0.58";
|
||||
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=
|
||||
@@ -6460,12 +6460,17 @@ async function checkForUpdates(sendStatus) {
|
||||
try {
|
||||
const resp = await fetchWithTimeout2(`${GITEA_BASE}/version.json`);
|
||||
if (!resp.ok) {
|
||||
plugin_default.logger.warn(`Update check: version.json fetch returned ${resp.status}`);
|
||||
sendStatus?.("Update check failed");
|
||||
return;
|
||||
}
|
||||
const { version } = await resp.json();
|
||||
if (!/^\d+\.\d+\.\d+$/.test(version)) return;
|
||||
if (!/^\d+\.\d+\.\d+$/.test(version)) {
|
||||
plugin_default.logger.warn(`Update check: version.json had unexpected content: ${JSON.stringify(version)}`);
|
||||
return;
|
||||
}
|
||||
if (!isNewerVersion(version, CURRENT_VERSION)) {
|
||||
plugin_default.logger.info(`Update check: up to date (v${CURRENT_VERSION}, server has v${version})`);
|
||||
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
|
||||
return;
|
||||
}
|
||||
@@ -6758,8 +6763,14 @@ plugin_default.ui.onSendToPlugin(async (ev) => {
|
||||
});
|
||||
var UPDATE_CHECK_INTERVAL_MS = 30 * 60 * 1e3;
|
||||
plugin_default.connect();
|
||||
setTimeout(() => checkForUpdates(), 1e4);
|
||||
setInterval(() => checkForUpdates(), UPDATE_CHECK_INTERVAL_MS);
|
||||
setTimeout(() => {
|
||||
plugin_default.logger.info("Running initial (10s post-launch) update check");
|
||||
checkForUpdates();
|
||||
}, 1e4);
|
||||
setInterval(() => {
|
||||
plugin_default.logger.info("Running scheduled (30min) update check");
|
||||
checkForUpdates();
|
||||
}, UPDATE_CHECK_INTERVAL_MS);
|
||||
/*! Bundled license information:
|
||||
|
||||
@elgato/schemas/dist/streamdeck/plugins/index.mjs:
|
||||
|
||||
Reference in New Issue
Block a user