{"record":{"id":"62e4a7ed53c45a2a","repo":"tonhowtf/omniget","slug":"player-failed-saving-spotify-heartbeat-interval-ms","errorCode":null,"errorMessage":"[player] failed saving spotify heartbeat_interval_ms","messagePattern":"\\[player\\] failed saving spotify heartbeat_interval_ms","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lib/study-music/player-store.svelte.ts","lineNumber":777,"sourceCode":"      this.stopSpotifyHeartbeat();\n    }\n  }\n\n  async setSpotifyHeartbeatIntervalMs(ms: number) {\n    const clamped = Math.min(\n      MusicPlayerStore.SPOTIFY_HEARTBEAT_MAX_MS,\n      Math.max(\n        MusicPlayerStore.SPOTIFY_HEARTBEAT_MIN_MS,\n        Math.floor(Number(ms) || 30_000),\n      ),\n    );\n    this._spotifyHeartbeatMs = clamped;\n    try {\n      await pluginInvoke(\"study\", \"study:music:spotify:settings:set\", {\n        heartbeat_interval_ms: clamped,\n      });\n    } catch (e) {\n      console.warn(\"[player] failed saving spotify heartbeat_interval_ms\", e);\n    }\n    if (this._spotifyHeartbeatHandle) {\n      this.stopSpotifyHeartbeat();\n      if (this.isSpotify() && this._spotifyIsPlaying) this.startSpotifyHeartbeat();\n    }\n  }\n\n  getSpotifyHeartbeatEnabled(): boolean {\n    return this._spotifyHeartbeatEnabled;\n  }\n\n  getSpotifyHeartbeatIntervalMs(): number {\n    return this._spotifyHeartbeatMs;\n  }\n\n  private static clampRpcInterval(ms: number): number {\n    return Math.min(\n      MusicPlayerStore.RPC_UPDATE_INTERVAL_MAX_MS,","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/study-music/player-store.svelte.ts#L759-L795","documentation":"A non-fatal console warning emitted by MusicPlayerStore when persisting the Spotify heartbeat interval to the backend via pluginInvoke('study','study:music:spotify:settings:set') throws. The in-memory value (_spotifyHeartbeatMs) was already applied, so the player keeps working with the new interval but it will not survive a restart.","triggerScenarios":"Calling the Spotify heartbeat interval setter while the Tauri 'study' plugin command study:music:spotify:settings:set rejects — e.g. plugin backend not running, settings file write failure, or IPC serialization error.","commonSituations":"App started before the study plugin backend initialized; disk-full or permission problems on the settings file; an older backend version that does not implement the spotify settings command.","solutions":["Check the backend 'study' plugin is registered and the command study:music:spotify:settings:set exists in the installed version","Inspect the caught error for an IPC/plugin-not-found cause and restart the app so the plugin initializes before changing the interval","Fix filesystem permission/disk issues preventing settings persistence","Retry the save once the backend is available; the value is already applied in memory"],"exampleFix":"// before\nawait pluginInvoke(\"study\", \"study:music:spotify:settings:set\", { heartbeat_interval_ms: clamped });\n// after\nif (await isPluginCommandAvailable(\"study\", \"study:music:spotify:settings:set\")) {\n  await pluginInvoke(\"study\", \"study:music:spotify:settings:set\", { heartbeat_interval_ms: clamped });\n} else {\n  queueSettingsSave({ heartbeat_interval_ms: clamped }); // retry once backend is up\n}","handlingStrategy":"try-catch","validationCode":"const ok = typeof ms === \"number\" && ms >= 1000 && ms <= 60000;","typeGuard":"function isFiniteMs(v: unknown): v is number { return typeof v === \"number\" && Number.isFinite(v) && v > 0; }","tryCatchPattern":"try { await pluginInvoke(\"study\", \"study:music:spotify:settings:set\", { heartbeat_interval_ms: clamped }); } catch (e) { console.warn(\"save deferred\", e); pendingSaves.push(() => pluginInvoke(\"study\", \"study:music:spotify:settings:set\", { heartbeat_interval_ms: clamped })); }","preventionTips":["Wait for backend readiness before writing settings","Clamp the interval client-side exactly as the store does","Treat the in-memory value as authoritative and retry persistence later"],"tags":["ipc","persistence","spotify"],"backgroundTag":"api-request-failed","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}