tonhowtf/omniget · warning

[player] failed loading spotify settings

Error message

[player] failed loading spotify settings

What it means

The Tauri plugin call study:music:spotify:settings:get threw while loading Spotify heartbeat settings into the player store; the error is logged and defaults (heartbeat enabled, 30s interval, clamped to the allowed range) remain in effect. Like the player-settings loader, the _spotifySettingsLoaded flag is set first, so it will not retry this session — purely a best-effort hydration failure.

Solutions

  1. Check the logged cause for plugin vs storage failure
  2. Verify the study plugin exposes study:music:spotify:settings:get
  3. Keep defaults and optionally retry after plugin readiness
  4. Re-save the settings via the UI toggles once the backend is reachable

Example fix

// before
catch (e) {
  console.warn("[player] failed loading spotify settings", e);
}
// after
catch (e) {
  console.warn("[player] failed loading spotify settings, using defaults", e);
  this._spotifyHeartbeatEnabled = false;
}
Defensive patterns

Strategy: fallback

Validate before calling

if (!pluginReady("study")) {
  console.warn("[player] spotify settings unavailable; using defaults");
  return;
}

Type guard

function isSpotifySettings(s: unknown): s is { heartbeat_enabled?: boolean; heartbeat_ms?: number } {
  return !!s && typeof s === "object";
}

Try / catch

try {
  const res = await pluginInvoke("study", "study:music:spotify:settings:get", {});
  apply(res);
} catch (e) {
  console.warn("[player] failed loading spotify settings, using defaults", e);
  this._spotifyHeartbeatEnabled = false;
}

Prevention

When it happens

Trigger: The settings:get pluginInvoke rejects — plugin unavailable, command missing on the backend, or storage read error.

Common situations: Backend version lacking the spotify settings command, plugin not started when loadSpotifySettings runs, or corrupted settings storage.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/989bb4a70fd35deb. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/study-music/player-store.svelte.ts:743

  private async loadSpotifySettings() {
    if (this._spotifySettingsLoaded) return;
    this._spotifySettingsLoaded = true;
    try {
      const res = await pluginInvoke<{
        heartbeat_enabled?: boolean;
        heartbeat_interval_ms?: number;
      }>("study", "study:music:spotify:settings:get", {});
      this._spotifyHeartbeatEnabled = res?.heartbeat_enabled ?? true;
      const ms = Number(res?.heartbeat_interval_ms ?? 30_000);
      this._spotifyHeartbeatMs = Number.isFinite(ms)
        ? Math.min(
            MusicPlayerStore.SPOTIFY_HEARTBEAT_MAX_MS,
            Math.max(MusicPlayerStore.SPOTIFY_HEARTBEAT_MIN_MS, ms),
          )
        : 30_000;
    } catch (e) {
      console.warn("[player] failed loading spotify settings", e);
    }
  }

  async setSpotifyHeartbeatEnabled(value: boolean) {
    this._spotifyHeartbeatEnabled = value;
    try {
      await pluginInvoke("study", "study:music:spotify:settings:set", {
        heartbeat_enabled: value,
      });
    } catch (e) {
      console.warn("[player] failed saving spotify heartbeat_enabled", e);
    }
    if (value && this.isSpotify() && this._spotifyIsPlaying) {
      this.startSpotifyHeartbeat();
    } else if (!value) {
      this.stopSpotifyHeartbeat();
    }
  }

View on GitHub (pinned to 8600b91f42)