mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-11 17:37:21 +10:00
fix(js-helper): stop sending version_unavailable to worker
log latest resolution failures in the client console instead avoid noisy worker error events when all latest sources fail
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
window.oneTime = true;
|
window.oneTime = true;
|
||||||
|
|
||||||
const WORKER_BASE_URL = "https://spotify-ingest-admin.amd64fox1.workers.dev";
|
const WORKER_BASE_URL = "https://spotify-ingest-admin.amd64fox1.workers.dev";
|
||||||
const SCRIPT_VERSION = "1.2.0";
|
const SCRIPT_VERSION = "1.2.1";
|
||||||
|
|
||||||
const SOURCE_LABELS = {
|
const SOURCE_LABELS = {
|
||||||
REMOTE: "latest.json",
|
REMOTE: "latest.json",
|
||||||
@@ -802,6 +802,16 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function logVersionUnavailable(state) {
|
||||||
|
console.error(ERROR_MESSAGES.version_unavailable, {
|
||||||
|
scriptVersion: SCRIPT_VERSION,
|
||||||
|
remoteVersionFailed: state.remoteVersionFailed,
|
||||||
|
realVersion: state.versionSources.realVersion || "",
|
||||||
|
latestJsonVersion: state.remoteShortVersion || "",
|
||||||
|
latestJsonFullVersion: state.remoteFullVersion || ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function runOnce(token) {
|
async function runOnce(token) {
|
||||||
const state = createState(token);
|
const state = createState(token);
|
||||||
|
|
||||||
@@ -820,7 +830,7 @@
|
|||||||
state.remoteFullVersion = version.remoteFullVersion;
|
state.remoteFullVersion = version.remoteFullVersion;
|
||||||
|
|
||||||
if (!state.spotifyAppVersion) {
|
if (!state.spotifyAppVersion) {
|
||||||
sendError(state, "version_unavailable");
|
logVersionUnavailable(state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user