tonhowtf/omniget · warning

[player] failed saving rpc update_interval_ms

Error message

[player] failed saving rpc update_interval_ms

What it means

Warning from the RPC update-interval setter: the clamped interval is applied locally and the RPC loop is restarted, but persisting update_interval_ms via study:music:rpc:music_settings:set failed, so the custom interval resets on next launch.

Solutions

  1. Wait for backend readiness before saving the interval
  2. Inspect the error for persistence (file write/permission) problems
  3. Retry the save; the runtime loop already uses the new value
  4. Align frontend and plugin versions

Example fix

// before
await pluginInvoke("study", "study:music:rpc:music_settings:set", { update_interval_ms: clamped });
// after
await backendReady("study");
await pluginInvoke("study", "study:music:rpc:music_settings:set", { update_interval_ms: clamped });
Defensive patterns

Strategy: validation

Validate before calling

const clamped = Math.min(Math.max(ms, MIN_RPC_INTERVAL), MAX_RPC_INTERVAL); if (!Number.isFinite(clamped)) return;

Type guard

function isValidInterval(v: unknown): v is number { return typeof v === "number" && Number.isFinite(v) && v >= 1000; }

Try / catch

try { await pluginInvoke("study", "study:music:rpc:music_settings:set", { update_interval_ms: clamped }); } catch (e) { console.warn("[player] failed saving rpc update_interval_ms", e); }

Prevention

When it happens

Trigger: Calling setRpcUpdateIntervalMs when the backend settings:set command rejects — plugin unavailable, IPC serialization failure, or settings file write error.

Common situations: Changing the interval right after app start before the plugin backend is ready; disk or permission issues; plugin version without this command.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

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

    try {
      await pluginInvoke("study", "study:music:rpc:music_settings:set", {
        show_buttons: value,
      });
    } catch (e) {
      console.warn("[player] failed saving rpc show_buttons", e);
    }
    this.rpcOnPlaybackChange();
  }

  async setRpcUpdateIntervalMs(ms: number) {
    const clamped = MusicPlayerStore.clampRpcInterval(ms);
    this._rpcUpdateIntervalMs = clamped;
    try {
      await pluginInvoke("study", "study:music:rpc:music_settings:set", {
        update_interval_ms: clamped,
      });
    } catch (e) {
      console.warn("[player] failed saving rpc update_interval_ms", e);
    }
    if (this._rpcTimer !== null) {
      this.stopRpcLoop();
      this.startRpcLoop();
    }
  }

  private rpcSnapshot(): {
    title: string;
    artist: string;
    album: string;
    duration: number;
    position: number;
    paused: boolean;
    large_image_key: string | null;
    large_image_text: string | null;
    small_image_key: string | null;
    small_image_text: string | null;

View on GitHub (pinned to 8600b91f42)